From 50f29752f5888ac194a5146c475720c29ae3f172 Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Thu, 13 Aug 2009 11:48:39 +0900 Subject: [PATCH 1/4] Formatting cleanup. Add copyright headers. --- .../Framework/Servers/BaseOpenSimServer.cs | 2 +- .../Inventory/BaseInventoryConnector.cs | 29 ++++++++++++++++++- .../Inventory/InventoryCache.cs | 29 ++++++++++++++++++- .../Tests/Common/Mock/TestInventoryService.cs | 29 ++++++++++++++++++- 4 files changed, 85 insertions(+), 4 deletions(-) diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs index 2a975284ed..7a244ff2ef 100644 --- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs +++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs @@ -443,7 +443,7 @@ namespace OpenSim.Framework.Servers string inputLine; int strcmp; - if (File.Exists( gitCommitFileName)) + if (File.Exists(gitCommitFileName)) { StreamReader CommitFile = File.OpenText(gitCommitFileName); buildVersion = Environment.NewLine + "git# " + CommitFile.ReadLine(); diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs index f2b736c67b..375faf59a3 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs @@ -1,4 +1,31 @@ -using System; +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; using System.Collections.Generic; using OpenMetaverse; diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs index 551a7ebf12..c16e92e22a 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs @@ -1,4 +1,31 @@ -using System; +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; using System.Collections.Generic; using System.Reflection; diff --git a/OpenSim/Tests/Common/Mock/TestInventoryService.cs b/OpenSim/Tests/Common/Mock/TestInventoryService.cs index 0c1916442d..6635700e00 100644 --- a/OpenSim/Tests/Common/Mock/TestInventoryService.cs +++ b/OpenSim/Tests/Common/Mock/TestInventoryService.cs @@ -1,4 +1,31 @@ -using System; +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; using System.Collections.Generic; using System.Text; using OpenSim.Framework; From b47e405420b316a2f68b3e6f4c5ed35dc713260e Mon Sep 17 00:00:00 2001 From: "Teravus Ovares (Dan Olivares)" Date: Wed, 12 Aug 2009 22:54:57 -0400 Subject: [PATCH 2/4] * minor: Comments --- OpenSim/Region/Application/Application.cs | 33 ++++++- .../Region/Application/ConfigurationLoader.cs | 45 ++++++++- .../Region/Application/IApplicationPlugin.cs | 12 +++ OpenSim/Region/Application/OpenSim.cs | 95 ++++++++++++++++++- 4 files changed, 181 insertions(+), 4 deletions(-) diff --git a/OpenSim/Region/Application/Application.cs b/OpenSim/Region/Application/Application.cs index ad157c611d..df8029046a 100644 --- a/OpenSim/Region/Application/Application.cs +++ b/OpenSim/Region/Application/Application.cs @@ -36,25 +36,47 @@ using OpenSim.Framework.Console; namespace OpenSim { + /// + /// Starting class for the OpenSimulator Region + /// public class Application { + /// + /// Text Console Logger + /// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + /// + /// Path to the main ini Configuration file + /// public static string iniFilePath = ""; + /// + /// Save Crashes in the bin/crashes folder. Configurable with m_crashDir + /// public static bool m_saveCrashDumps = false; + + /// + /// Directory to save crash reports to. Relative to bin/ + /// public static string m_crashDir = "crashes"; + /// + /// Instance of the OpenSim class. This could be OpenSim or OpenSimBackground depending on the configuration + /// protected static OpenSimBase m_sim = null; //could move our main function into OpenSimMain and kill this class public static void Main(string[] args) { - // First line + // First line, hook the appdomain to the crash reporter AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); + // Add the arguments supplied when running the application to the configuration ArgvConfigSource configSource = new ArgvConfigSource(args); + + // Configure Log4Net configSource.AddSwitch("Startup", "logconfig"); string logConfigFile = configSource.Configs["Startup"].GetString("logconfig", String.Empty); if (logConfigFile != String.Empty) @@ -69,6 +91,8 @@ namespace OpenSim m_log.Info("[OPENSIM MAIN]: configured log4net using default OpenSim.exe.config"); } + // Check if the system is compatible with OpenSimulator. + // Ensures that the minimum system requirements are met m_log.Info("Performing compatibility checks... "); string supported = String.Empty; if (Util.IsEnvironmentSupported(ref supported)) @@ -80,6 +104,7 @@ namespace OpenSim m_log.Warn("Environment is unsupported (" + supported + ")\n"); } + // Configure nIni aliases and localles Culture.SetCurrentCulture(); @@ -99,8 +124,13 @@ namespace OpenSim configSource.AddConfig("StandAlone"); configSource.AddConfig("Network"); + // Check if we're running in the background or not bool background = configSource.Configs["Startup"].GetBoolean("background", false); + + // Check if we're saving crashes m_saveCrashDumps = configSource.Configs["Startup"].GetBoolean("save_crashes", false); + + // load Crash directory config m_crashDir = configSource.Configs["Startup"].GetString("crash_dir", m_crashDir); if (background) @@ -118,6 +148,7 @@ namespace OpenSim { try { + // Block thread here for input MainConsole.Instance.Prompt(); } catch (Exception e) diff --git a/OpenSim/Region/Application/ConfigurationLoader.cs b/OpenSim/Region/Application/ConfigurationLoader.cs index 3a6524275d..c3e7b867bc 100644 --- a/OpenSim/Region/Application/ConfigurationLoader.cs +++ b/OpenSim/Region/Application/ConfigurationLoader.cs @@ -37,12 +37,32 @@ using OpenSim.Framework; namespace OpenSim { + /// + /// Loads the Configuration files into nIni + /// public class ConfigurationLoader { + /// + /// Various Config settings the region needs to start + /// Physics Engine, Mesh Engine, GridMode, PhysicsPrim allowed, Neighbor, + /// StorageDLL, Storage Connection String, Estate connection String, Client Stack + /// Standalone settings. + /// protected ConfigSettings m_configSettings; + + /// + /// A source of Configuration data + /// protected OpenSimConfigSource m_config; + + /// + /// Grid Service Information. This refers to classes and addresses of the grid service + /// protected NetworkServersInfo m_networkServersInfo; + /// + /// Console logger + /// private static readonly ILog m_log = LogManager.GetLogger( MethodBase.GetCurrentMethod().DeclaringType); @@ -51,6 +71,13 @@ namespace OpenSim { } + /// + /// Loads the region configuration + /// + /// Parameters passed into the process when started + /// + /// + /// A configuration that gets passed to modules public OpenSimConfigSource LoadConfigSettings( IConfigSource argvSource, out ConfigSettings configSettings, out NetworkServersInfo networkInfo) @@ -169,15 +196,22 @@ namespace OpenSim return m_config; } + /// + /// Adds the included files as ini configuration files + /// + /// List of URL strings or filename strings private void AddIncludes(List sources) { + //loop over config sources foreach (IConfig config in m_config.Source.Configs) { + // Look for Include-* in the key name string[] keys = config.GetKeys(); foreach (string k in keys) { if (k.StartsWith("Include-")) { + // read the config file to be included. string file = config.GetString(k); if (IsUri(file)) { @@ -199,7 +233,11 @@ namespace OpenSim } } } - + /// + /// Check if we can convert the string to a URI + /// + /// String uri to the remote resource + /// true if we can convert the string to a Uri object bool IsUri(string file) { Uri configUri; @@ -253,7 +291,7 @@ namespace OpenSim /// /// Setup a default config values in case they aren't present in the ini file /// - /// + /// A Configuration source containing the default configuration private static IConfigSource DefaultConfig() { IConfigSource defaultConfig = new IniConfigSource(); @@ -322,6 +360,9 @@ namespace OpenSim return defaultConfig; } + /// + /// Read initial region settings from the ConfigSource + /// protected virtual void ReadConfigSettings() { IConfig startupConfig = m_config.Source.Configs["Startup"]; diff --git a/OpenSim/Region/Application/IApplicationPlugin.cs b/OpenSim/Region/Application/IApplicationPlugin.cs index 1e1dae04b2..6e6d48c51f 100644 --- a/OpenSim/Region/Application/IApplicationPlugin.cs +++ b/OpenSim/Region/Application/IApplicationPlugin.cs @@ -29,12 +29,24 @@ using OpenSim.Framework; namespace OpenSim { + /// + /// OpenSimulator Application Plugin framework interface + /// public interface IApplicationPlugin : IPlugin { + /// + /// Initialize the Plugin + /// + /// The Application instance void Initialise(OpenSimBase openSim); + + /// + /// Called when the application loading is completed + /// void PostInitialise(); } + public class ApplicationPluginInitialiser : PluginInitialiserBase { private OpenSimBase server; diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index aeb6f57b1d..390cfcd020 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -146,6 +146,9 @@ namespace OpenSim ChangeSelectedRegion("region", new string[] {"change", "region", "root"}); } + /// + /// Register standard set of region console commands + /// private void RegisterConsoleCommands() { m_console.Commands.AddCommand("region", false, "clear assets", @@ -332,6 +335,11 @@ namespace OpenSim base.ShutdownSpecific(); } + /// + /// Timer to run a specific text file as console commands. Configured in in the main ini file + /// + /// + /// private void RunAutoTimerScript(object sender, EventArgs e) { if (m_timedScript != "disabled") @@ -342,6 +350,11 @@ namespace OpenSim #region Console Commands + /// + /// Kicks users off the region + /// + /// + /// name of avatar to kick private void KickUserCommand(string module, string[] cmdparams) { if (cmdparams.Length < 4) @@ -401,6 +414,10 @@ namespace OpenSim } } + /// + /// Opens a file and uses it as input to the console command parser. + /// + /// name of file to use as input to the console private static void PrintFileToConsole(string fileName) { if (File.Exists(fileName)) @@ -419,12 +436,22 @@ namespace OpenSim m_log.Info("Not implemented."); } + /// + /// Force resending of all updates to all clients in active region(s) + /// + /// + /// private void HandleForceUpdate(string module, string[] args) { m_log.Info("Updating all clients"); m_sceneManager.ForceCurrentSceneClientUpdate(); } + /// + /// Edits the scale of a primative with the name specified + /// + /// + /// 0,1, name, x, y, z private void HandleEditScale(string module, string[] args) { if (args.Length == 6) @@ -437,6 +464,11 @@ namespace OpenSim } } + /// + /// Creates a new region based on the parameters specified. This will ask the user questions on the console + /// + /// + /// 0,1,region name, region XML file private void HandleCreateRegion(string module, string[] cmd) { if (cmd.Length < 4) @@ -473,16 +505,32 @@ namespace OpenSim } } + /// + /// Enable logins + /// + /// + /// private void HandleLoginEnable(string module, string[] cmd) { ProcessLogin(true); } + + /// + /// Disable logins + /// + /// + /// private void HandleLoginDisable(string module, string[] cmd) { ProcessLogin(false); } + /// + /// Log login status to the console + /// + /// + /// private void HandleLoginStatus(string module, string[] cmd) { if (m_commsManager.GridService.RegionLoginsEnabled == false) @@ -492,6 +540,12 @@ namespace OpenSim m_log.Info("[ Login ] Login are enabled"); } + + /// + /// Change and load configuration file data. + /// + /// + /// private void HandleConfig(string module, string[] cmd) { List args = new List(cmd); @@ -557,6 +611,12 @@ namespace OpenSim } } + + /// + /// Load, Unload, and list Region modules in use + /// + /// + /// private void HandleModules(string module, string[] cmd) { List args = new List(cmd); @@ -797,6 +857,11 @@ namespace OpenSim } // see BaseOpenSimServer + /// + /// Many commands list objects for debugging. Some of the types are listed here + /// + /// + /// public override void HandleShow(string mod, string[] cmd) { base.HandleShow(mod, cmd); @@ -902,6 +967,10 @@ namespace OpenSim } } + /// + /// print UDP Queue data for each client + /// + /// private string GetQueuesReport() { string report = String.Empty; @@ -1010,6 +1079,11 @@ namespace OpenSim m_commsManager.UserAdminService.ResetUserPassword(firstName, lastName, newPassword); } + /// + /// Use XML2 format to serialize data to a file + /// + /// + /// protected void SavePrimsXml2(string module, string[] cmdparams) { if (cmdparams.Length > 5) @@ -1022,6 +1096,11 @@ namespace OpenSim } } + /// + /// Use XML format to serialize data to a file + /// + /// + /// protected void SaveXml(string module, string[] cmdparams) { m_log.Error("[CONSOLE]: PLEASE NOTE, save-xml is DEPRECATED and may be REMOVED soon. If you are using this and there is some reason you can't use save-xml2, please file a mantis detailing the reason."); @@ -1036,6 +1115,11 @@ namespace OpenSim } } + /// + /// Loads data and region objects from XML format. + /// + /// + /// protected void LoadXml(string module, string[] cmdparams) { m_log.Error("[CONSOLE]: PLEASE NOTE, load-xml is DEPRECATED and may be REMOVED soon. If you are using this and there is some reason you can't use load-xml2, please file a mantis detailing the reason."); @@ -1079,7 +1163,11 @@ namespace OpenSim } } } - + /// + /// Serialize region data to XML2Format + /// + /// + /// protected void SaveXml2(string module, string[] cmdparams) { if (cmdparams.Length > 2) @@ -1092,6 +1180,11 @@ namespace OpenSim } } + /// + /// Load region data from Xml2Format + /// + /// + /// protected void LoadXml2(string module, string[] cmdparams) { if (cmdparams.Length > 2) From 18634e9dd8464ee7514587d0645e38f529f0bb3e Mon Sep 17 00:00:00 2001 From: "Teravus Ovares (Dan Olivares)" Date: Wed, 12 Aug 2009 23:18:00 -0400 Subject: [PATCH 3/4] minor: comments --- OpenSim/Client/Linden/LLClientStackModule.cs | 6 ++ OpenSim/Framework/ACL.cs | 19 ++++++ OpenSim/Framework/AgentCircuitData.cs | 68 ++++++++++++++++++++ OpenSim/Framework/AgentUpdateArgs.cs | 34 ++++++++++ 4 files changed, 127 insertions(+) diff --git a/OpenSim/Client/Linden/LLClientStackModule.cs b/OpenSim/Client/Linden/LLClientStackModule.cs index a9649894ea..f882d5d301 100644 --- a/OpenSim/Client/Linden/LLClientStackModule.cs +++ b/OpenSim/Client/Linden/LLClientStackModule.cs @@ -41,12 +41,18 @@ using OpenSim.Region.Framework.Interfaces; namespace OpenSim.Client.Linden { + /// + /// Linden UDP Stack Region Module + /// public class LLClientStackModule : INonSharedRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); #region IRegionModule Members + /// + /// Scene that contains the region's data + /// protected Scene m_scene; protected bool m_createClientStack = false; protected IClientNetworkServer m_clientServer; diff --git a/OpenSim/Framework/ACL.cs b/OpenSim/Framework/ACL.cs index 9d7827e752..3b1c0f0f63 100644 --- a/OpenSim/Framework/ACL.cs +++ b/OpenSim/Framework/ACL.cs @@ -46,6 +46,11 @@ namespace OpenSim.Framework private Dictionary Resources = new Dictionary(); private Dictionary Roles = new Dictionary(); + /// + /// Adds a new role + /// + /// + /// public ACL AddRole(Role role) { if (Roles.ContainsKey(role.Name)) @@ -56,6 +61,11 @@ namespace OpenSim.Framework return this; } + /// + /// Adds a new resource + /// + /// + /// public ACL AddResource(Resource resource) { Resources.Add(resource.Name, resource); @@ -63,6 +73,12 @@ namespace OpenSim.Framework return this; } + /// + /// Permision for user/roll on a resource + /// + /// + /// + /// public Permission HasPermission(string role, string resource) { if (!Roles.ContainsKey(role)) @@ -234,6 +250,9 @@ namespace OpenSim.Framework #region Tests + /// + /// ACL Test class + /// internal class ACLTester { public ACLTester() diff --git a/OpenSim/Framework/AgentCircuitData.cs b/OpenSim/Framework/AgentCircuitData.cs index c38f0c36f2..6472f317a2 100644 --- a/OpenSim/Framework/AgentCircuitData.cs +++ b/OpenSim/Framework/AgentCircuitData.cs @@ -32,26 +32,83 @@ using OpenMetaverse.StructuredData; namespace OpenSim.Framework { + /// + /// Circuit data for an agent. Connection information shared between + /// regions that accept UDP connections from a client + /// public class AgentCircuitData { + /// + /// Avatar Unique Agent Identifier + /// public UUID AgentID; + + /// + /// Avatar's Appearance + /// public AvatarAppearance Appearance; + + /// + /// Agent's root inventory folder + /// public UUID BaseFolder; + + /// + /// Base Caps path for user + /// public string CapsPath = String.Empty; + + /// + /// Seed caps for neighbor regions that the user can see into + /// public Dictionary ChildrenCapSeeds; + + /// + /// Root agent, or Child agent + /// public bool child; + + /// + /// Number given to the client when they log-in that they provide + /// as credentials to the UDP server + /// public uint circuitcode; + + /// + /// Agent's account first name + /// public string firstname; public UUID InventoryFolder; + + /// + /// Agent's account last name + /// public string lastname; + + /// + /// Random Unique GUID for this session. Client gets this at login and it's + /// only supposed to be disclosed over secure channels + /// public UUID SecureSessionID; + + /// + /// Non secure Session ID + /// public UUID SessionID; + + /// + /// Position the Agent's Avatar starts in the region + /// public Vector3 startpos; public AgentCircuitData() { } + /// + /// Create AgentCircuitData from a Serializable AgentCircuitData + /// + /// public AgentCircuitData(sAgentCircuitData cAgent) { AgentID = new UUID(cAgent.AgentID); @@ -68,6 +125,10 @@ namespace OpenSim.Framework ChildrenCapSeeds = cAgent.ChildrenCapSeeds; } + /// + /// Pack AgentCircuitData into an OSDMap for transmission over LLSD XML or LLSD json + /// + /// map of the agent circuit data public OSDMap PackAgentCircuitData() { OSDMap args = new OSDMap(); @@ -98,6 +159,10 @@ namespace OpenSim.Framework return args; } + /// + /// Unpack agent circuit data map into an AgentCiruitData object + /// + /// public void UnpackAgentCircuitData(OSDMap args) { if (args["agent_id"] != null) @@ -150,6 +215,9 @@ namespace OpenSim.Framework } } + /// + /// Serializable Agent Circuit Data + /// [Serializable] public class sAgentCircuitData { diff --git a/OpenSim/Framework/AgentUpdateArgs.cs b/OpenSim/Framework/AgentUpdateArgs.cs index a19795d655..7b9ec68966 100644 --- a/OpenSim/Framework/AgentUpdateArgs.cs +++ b/OpenSim/Framework/AgentUpdateArgs.cs @@ -30,18 +30,52 @@ using OpenMetaverse; namespace OpenSim.Framework { + /// + /// Client provided parameters for avatar movement + /// public class AgentUpdateArgs : EventArgs { + /// + /// Agent's unique ID + /// public UUID AgentID; + + /// + /// Rotation of the avatar's body + /// public Quaternion BodyRotation; + + /// + /// AT portion of the camera matrix + /// public Vector3 CameraAtAxis; + + /// + /// Position of the camera in the Scene + /// public Vector3 CameraCenter; public Vector3 CameraLeftAxis; public Vector3 CameraUpAxis; + + /// + /// Bitflag field for agent movement. Fly, forward, backward, turn left, turn right, go up, go down, Straffe, etc. + /// public uint ControlFlags; + + /// + /// Agent's client Draw distance setting + /// public float Far; public byte Flags; + + /// + /// Rotation of the avatar's head + /// public Quaternion HeadRotation; + + /// + /// Session Id + /// public UUID SessionID; public byte State; } From 0a85d1d767d5ab3b37a3a1a797be843d0b54780e Mon Sep 17 00:00:00 2001 From: "Teravus Ovares (Dan Olivares)" Date: Wed, 12 Aug 2009 23:34:12 -0400 Subject: [PATCH 4/4] minor:comments --- OpenSim/Framework/Animation.cs | 30 +++++++++++++++++++ OpenSim/Framework/AssetBase.cs | 29 +++++++++++++++++- OpenSim/Framework/AvatarAppearance.cs | 7 ++--- OpenSim/Framework/AvatarPickerAvatar.cs | 14 +++++++++ .../AvatarPickerReplyAgentDataArgs.cs | 10 +++++++ OpenSim/Framework/Culture.cs | 3 ++ OpenSim/Framework/LandData.cs | 3 ++ 7 files changed, 91 insertions(+), 5 deletions(-) diff --git a/OpenSim/Framework/Animation.cs b/OpenSim/Framework/Animation.cs index 9f865135ed..232f5a1893 100644 --- a/OpenSim/Framework/Animation.cs +++ b/OpenSim/Framework/Animation.cs @@ -31,10 +31,17 @@ using OpenMetaverse.StructuredData; namespace OpenSim.Framework { + /// + /// Information about an Animation + /// [Serializable] public class Animation { private UUID animID; + + /// + /// ID of Animation + /// public UUID AnimID { get { return animID; } @@ -49,6 +56,10 @@ namespace OpenSim.Framework } private UUID objectID; + + /// + /// Unique ID of object that is being animated + /// public UUID ObjectID { get { return objectID; } @@ -59,6 +70,12 @@ namespace OpenSim.Framework { } + /// + /// Creates an Animation based on the data + /// + /// UUID ID of animation + /// + /// ID of object to be animated public Animation(UUID animID, int sequenceNum, UUID objectID) { this.animID = animID; @@ -66,11 +83,20 @@ namespace OpenSim.Framework this.objectID = objectID; } + /// + /// Animation from OSDMap from LLSD XML or LLSD json + /// + /// public Animation(OSDMap args) { UnpackUpdateMessage(args); } + + /// + /// Pack this object up as an OSDMap for transferring via LLSD XML or LLSD json + /// + /// public OSDMap PackUpdateMessage() { OSDMap anim = new OSDMap(); @@ -80,6 +106,10 @@ namespace OpenSim.Framework return anim; } + /// + /// Fill object with data from OSDMap + /// + /// public void UnpackUpdateMessage(OSDMap args) { if (args["animation"] != null) diff --git a/OpenSim/Framework/AssetBase.cs b/OpenSim/Framework/AssetBase.cs index 614670cc81..9679ff2512 100644 --- a/OpenSim/Framework/AssetBase.cs +++ b/OpenSim/Framework/AssetBase.cs @@ -31,10 +31,20 @@ using OpenMetaverse; namespace OpenSim.Framework { + /// + /// Asset class. All Assets are reference by this class or a class derived from this class + /// [Serializable] public class AssetBase { + /// + /// Data of the Asset + /// private byte[] m_data; + + /// + /// Meta Data of the Asset + /// private AssetMetadata m_metadata; public AssetBase() @@ -71,6 +81,9 @@ namespace OpenSim.Framework } + /// + /// Checks if this asset is a binary or text asset + /// public bool IsBinaryAsset { get @@ -102,12 +115,17 @@ namespace OpenSim.Framework set { m_data = value; } } + /// + /// Asset UUID + /// public UUID FullID { get { return m_metadata.FullID; } set { m_metadata.FullID = value; } } - + /// + /// Asset MetaData ID (transferring from UUID to string ID) + /// public string ID { get { return m_metadata.ID; } @@ -126,18 +144,27 @@ namespace OpenSim.Framework set { m_metadata.Description = value; } } + /// + /// (sbyte) AssetType enum + /// public sbyte Type { get { return m_metadata.Type; } set { m_metadata.Type = value; } } + /// + /// Is this a region only asset, or does this exist on the asset server also + /// public bool Local { get { return m_metadata.Local; } set { m_metadata.Local = value; } } + /// + /// Is this asset going to be saved to the asset database? + /// public bool Temporary { get { return m_metadata.Temporary; } diff --git a/OpenSim/Framework/AvatarAppearance.cs b/OpenSim/Framework/AvatarAppearance.cs index 6a07bc962f..7270f32646 100644 --- a/OpenSim/Framework/AvatarAppearance.cs +++ b/OpenSim/Framework/AvatarAppearance.cs @@ -28,14 +28,13 @@ using System; using System.Collections; using System.Collections.Generic; -using System.Runtime.Serialization; -using System.Security.Permissions; using OpenMetaverse; -using log4net; -using System.Reflection; namespace OpenSim.Framework { + /// + /// Contains the Avatar's Appearance and methods to manipulate the appearance. + /// public class AvatarAppearance { //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); diff --git a/OpenSim/Framework/AvatarPickerAvatar.cs b/OpenSim/Framework/AvatarPickerAvatar.cs index 0e8602dd81..200c054b5f 100644 --- a/OpenSim/Framework/AvatarPickerAvatar.cs +++ b/OpenSim/Framework/AvatarPickerAvatar.cs @@ -29,10 +29,24 @@ using OpenMetaverse; namespace OpenSim.Framework { + /// + /// Avatar returned by the Avatar Picker request + /// public class AvatarPickerAvatar { + /// + /// Avatar's Unique ID + /// public UUID AvatarID; + + /// + /// Avatar's Account first name + /// public string firstName; + + /// + /// Avatar's Account last name + /// public string lastName; } } diff --git a/OpenSim/Framework/AvatarPickerReplyAgentDataArgs.cs b/OpenSim/Framework/AvatarPickerReplyAgentDataArgs.cs index 8fd21d710d..54835da929 100644 --- a/OpenSim/Framework/AvatarPickerReplyAgentDataArgs.cs +++ b/OpenSim/Framework/AvatarPickerReplyAgentDataArgs.cs @@ -30,9 +30,19 @@ using OpenMetaverse; namespace OpenSim.Framework { + /// + /// Args to return to a client that queries picker data + /// public class AvatarPickerReplyAgentDataArgs : EventArgs { + /// + /// Unique Agent ID + /// public UUID AgentID; + + /// + /// ID of query user submitted + /// public UUID QueryID; } } diff --git a/OpenSim/Framework/Culture.cs b/OpenSim/Framework/Culture.cs index c76841dc89..2066794671 100644 --- a/OpenSim/Framework/Culture.cs +++ b/OpenSim/Framework/Culture.cs @@ -45,6 +45,9 @@ namespace OpenSim.Framework get { return m_cultureInfo; } } + /// + /// Set Culture to en-US to make string processing of numbers simpler. + /// public static void SetCurrentCulture() { Thread.CurrentThread.CurrentCulture = m_cultureInfo; diff --git a/OpenSim/Framework/LandData.cs b/OpenSim/Framework/LandData.cs index d6afb9547a..94c0d3b1c1 100644 --- a/OpenSim/Framework/LandData.cs +++ b/OpenSim/Framework/LandData.cs @@ -31,6 +31,9 @@ using OpenMetaverse; namespace OpenSim.Framework { + /// + /// Details of a Parcel of land + /// public class LandData { private Vector3 _AABBMax = new Vector3();