Merge branch 'master' of ssh://diva@opensimulator.org/var/git/opensim

arthursv
Diva Canto 2009-08-12 20:40:49 -07:00
commit b0292d59a5
19 changed files with 484 additions and 13 deletions

View File

@ -41,12 +41,18 @@ using OpenSim.Region.Framework.Interfaces;
namespace OpenSim.Client.Linden namespace OpenSim.Client.Linden
{ {
/// <summary>
/// Linden UDP Stack Region Module
/// </summary>
public class LLClientStackModule : INonSharedRegionModule public class LLClientStackModule : INonSharedRegionModule
{ {
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
#region IRegionModule Members #region IRegionModule Members
/// <summary>
/// Scene that contains the region's data
/// </summary>
protected Scene m_scene; protected Scene m_scene;
protected bool m_createClientStack = false; protected bool m_createClientStack = false;
protected IClientNetworkServer m_clientServer; protected IClientNetworkServer m_clientServer;

View File

@ -46,6 +46,11 @@ namespace OpenSim.Framework
private Dictionary<string, Resource> Resources = new Dictionary<string, Resource>(); private Dictionary<string, Resource> Resources = new Dictionary<string, Resource>();
private Dictionary<string, Role> Roles = new Dictionary<string, Role>(); private Dictionary<string, Role> Roles = new Dictionary<string, Role>();
/// <summary>
/// Adds a new role
/// </summary>
/// <param name="role"></param>
/// <returns></returns>
public ACL AddRole(Role role) public ACL AddRole(Role role)
{ {
if (Roles.ContainsKey(role.Name)) if (Roles.ContainsKey(role.Name))
@ -56,6 +61,11 @@ namespace OpenSim.Framework
return this; return this;
} }
/// <summary>
/// Adds a new resource
/// </summary>
/// <param name="resource"></param>
/// <returns></returns>
public ACL AddResource(Resource resource) public ACL AddResource(Resource resource)
{ {
Resources.Add(resource.Name, resource); Resources.Add(resource.Name, resource);
@ -63,6 +73,12 @@ namespace OpenSim.Framework
return this; return this;
} }
/// <summary>
/// Permision for user/roll on a resource
/// </summary>
/// <param name="role"></param>
/// <param name="resource"></param>
/// <returns></returns>
public Permission HasPermission(string role, string resource) public Permission HasPermission(string role, string resource)
{ {
if (!Roles.ContainsKey(role)) if (!Roles.ContainsKey(role))
@ -234,6 +250,9 @@ namespace OpenSim.Framework
#region Tests #region Tests
/// <summary>
/// ACL Test class
/// </summary>
internal class ACLTester internal class ACLTester
{ {
public ACLTester() public ACLTester()

View File

@ -32,26 +32,83 @@ using OpenMetaverse.StructuredData;
namespace OpenSim.Framework namespace OpenSim.Framework
{ {
/// <summary>
/// Circuit data for an agent. Connection information shared between
/// regions that accept UDP connections from a client
/// </summary>
public class AgentCircuitData public class AgentCircuitData
{ {
/// <summary>
/// Avatar Unique Agent Identifier
/// </summary>
public UUID AgentID; public UUID AgentID;
/// <summary>
/// Avatar's Appearance
/// </summary>
public AvatarAppearance Appearance; public AvatarAppearance Appearance;
/// <summary>
/// Agent's root inventory folder
/// </summary>
public UUID BaseFolder; public UUID BaseFolder;
/// <summary>
/// Base Caps path for user
/// </summary>
public string CapsPath = String.Empty; public string CapsPath = String.Empty;
/// <summary>
/// Seed caps for neighbor regions that the user can see into
/// </summary>
public Dictionary<ulong, string> ChildrenCapSeeds; public Dictionary<ulong, string> ChildrenCapSeeds;
/// <summary>
/// Root agent, or Child agent
/// </summary>
public bool child; public bool child;
/// <summary>
/// Number given to the client when they log-in that they provide
/// as credentials to the UDP server
/// </summary>
public uint circuitcode; public uint circuitcode;
/// <summary>
/// Agent's account first name
/// </summary>
public string firstname; public string firstname;
public UUID InventoryFolder; public UUID InventoryFolder;
/// <summary>
/// Agent's account last name
/// </summary>
public string lastname; public string lastname;
/// <summary>
/// Random Unique GUID for this session. Client gets this at login and it's
/// only supposed to be disclosed over secure channels
/// </summary>
public UUID SecureSessionID; public UUID SecureSessionID;
/// <summary>
/// Non secure Session ID
/// </summary>
public UUID SessionID; public UUID SessionID;
/// <summary>
/// Position the Agent's Avatar starts in the region
/// </summary>
public Vector3 startpos; public Vector3 startpos;
public AgentCircuitData() public AgentCircuitData()
{ {
} }
/// <summary>
/// Create AgentCircuitData from a Serializable AgentCircuitData
/// </summary>
/// <param name="cAgent"></param>
public AgentCircuitData(sAgentCircuitData cAgent) public AgentCircuitData(sAgentCircuitData cAgent)
{ {
AgentID = new UUID(cAgent.AgentID); AgentID = new UUID(cAgent.AgentID);
@ -68,6 +125,10 @@ namespace OpenSim.Framework
ChildrenCapSeeds = cAgent.ChildrenCapSeeds; ChildrenCapSeeds = cAgent.ChildrenCapSeeds;
} }
/// <summary>
/// Pack AgentCircuitData into an OSDMap for transmission over LLSD XML or LLSD json
/// </summary>
/// <returns>map of the agent circuit data</returns>
public OSDMap PackAgentCircuitData() public OSDMap PackAgentCircuitData()
{ {
OSDMap args = new OSDMap(); OSDMap args = new OSDMap();
@ -98,6 +159,10 @@ namespace OpenSim.Framework
return args; return args;
} }
/// <summary>
/// Unpack agent circuit data map into an AgentCiruitData object
/// </summary>
/// <param name="args"></param>
public void UnpackAgentCircuitData(OSDMap args) public void UnpackAgentCircuitData(OSDMap args)
{ {
if (args["agent_id"] != null) if (args["agent_id"] != null)
@ -150,6 +215,9 @@ namespace OpenSim.Framework
} }
} }
/// <summary>
/// Serializable Agent Circuit Data
/// </summary>
[Serializable] [Serializable]
public class sAgentCircuitData public class sAgentCircuitData
{ {

View File

@ -30,18 +30,52 @@ using OpenMetaverse;
namespace OpenSim.Framework namespace OpenSim.Framework
{ {
/// <summary>
/// Client provided parameters for avatar movement
/// </summary>
public class AgentUpdateArgs : EventArgs public class AgentUpdateArgs : EventArgs
{ {
/// <summary>
/// Agent's unique ID
/// </summary>
public UUID AgentID; public UUID AgentID;
/// <summary>
/// Rotation of the avatar's body
/// </summary>
public Quaternion BodyRotation; public Quaternion BodyRotation;
/// <summary>
/// AT portion of the camera matrix
/// </summary>
public Vector3 CameraAtAxis; public Vector3 CameraAtAxis;
/// <summary>
/// Position of the camera in the Scene
/// </summary>
public Vector3 CameraCenter; public Vector3 CameraCenter;
public Vector3 CameraLeftAxis; public Vector3 CameraLeftAxis;
public Vector3 CameraUpAxis; public Vector3 CameraUpAxis;
/// <summary>
/// Bitflag field for agent movement. Fly, forward, backward, turn left, turn right, go up, go down, Straffe, etc.
/// </summary>
public uint ControlFlags; public uint ControlFlags;
/// <summary>
/// Agent's client Draw distance setting
/// </summary>
public float Far; public float Far;
public byte Flags; public byte Flags;
/// <summary>
/// Rotation of the avatar's head
/// </summary>
public Quaternion HeadRotation; public Quaternion HeadRotation;
/// <summary>
/// Session Id
/// </summary>
public UUID SessionID; public UUID SessionID;
public byte State; public byte State;
} }

View File

@ -31,10 +31,17 @@ using OpenMetaverse.StructuredData;
namespace OpenSim.Framework namespace OpenSim.Framework
{ {
/// <summary>
/// Information about an Animation
/// </summary>
[Serializable] [Serializable]
public class Animation public class Animation
{ {
private UUID animID; private UUID animID;
/// <summary>
/// ID of Animation
/// </summary>
public UUID AnimID public UUID AnimID
{ {
get { return animID; } get { return animID; }
@ -49,6 +56,10 @@ namespace OpenSim.Framework
} }
private UUID objectID; private UUID objectID;
/// <summary>
/// Unique ID of object that is being animated
/// </summary>
public UUID ObjectID public UUID ObjectID
{ {
get { return objectID; } get { return objectID; }
@ -59,6 +70,12 @@ namespace OpenSim.Framework
{ {
} }
/// <summary>
/// Creates an Animation based on the data
/// </summary>
/// <param name="animID">UUID ID of animation</param>
/// <param name="sequenceNum"></param>
/// <param name="objectID">ID of object to be animated</param>
public Animation(UUID animID, int sequenceNum, UUID objectID) public Animation(UUID animID, int sequenceNum, UUID objectID)
{ {
this.animID = animID; this.animID = animID;
@ -66,11 +83,20 @@ namespace OpenSim.Framework
this.objectID = objectID; this.objectID = objectID;
} }
/// <summary>
/// Animation from OSDMap from LLSD XML or LLSD json
/// </summary>
/// <param name="args"></param>
public Animation(OSDMap args) public Animation(OSDMap args)
{ {
UnpackUpdateMessage(args); UnpackUpdateMessage(args);
} }
/// <summary>
/// Pack this object up as an OSDMap for transferring via LLSD XML or LLSD json
/// </summary>
/// <returns></returns>
public OSDMap PackUpdateMessage() public OSDMap PackUpdateMessage()
{ {
OSDMap anim = new OSDMap(); OSDMap anim = new OSDMap();
@ -80,6 +106,10 @@ namespace OpenSim.Framework
return anim; return anim;
} }
/// <summary>
/// Fill object with data from OSDMap
/// </summary>
/// <param name="args"></param>
public void UnpackUpdateMessage(OSDMap args) public void UnpackUpdateMessage(OSDMap args)
{ {
if (args["animation"] != null) if (args["animation"] != null)

View File

@ -31,10 +31,20 @@ using OpenMetaverse;
namespace OpenSim.Framework namespace OpenSim.Framework
{ {
/// <summary>
/// Asset class. All Assets are reference by this class or a class derived from this class
/// </summary>
[Serializable] [Serializable]
public class AssetBase public class AssetBase
{ {
/// <summary>
/// Data of the Asset
/// </summary>
private byte[] m_data; private byte[] m_data;
/// <summary>
/// Meta Data of the Asset
/// </summary>
private AssetMetadata m_metadata; private AssetMetadata m_metadata;
public AssetBase() public AssetBase()
@ -71,6 +81,9 @@ namespace OpenSim.Framework
} }
/// <summary>
/// Checks if this asset is a binary or text asset
/// </summary>
public bool IsBinaryAsset public bool IsBinaryAsset
{ {
get get
@ -102,12 +115,17 @@ namespace OpenSim.Framework
set { m_data = value; } set { m_data = value; }
} }
/// <summary>
/// Asset UUID
/// </summary>
public UUID FullID public UUID FullID
{ {
get { return m_metadata.FullID; } get { return m_metadata.FullID; }
set { m_metadata.FullID = value; } set { m_metadata.FullID = value; }
} }
/// <summary>
/// Asset MetaData ID (transferring from UUID to string ID)
/// </summary>
public string ID public string ID
{ {
get { return m_metadata.ID; } get { return m_metadata.ID; }
@ -126,18 +144,27 @@ namespace OpenSim.Framework
set { m_metadata.Description = value; } set { m_metadata.Description = value; }
} }
/// <summary>
/// (sbyte) AssetType enum
/// </summary>
public sbyte Type public sbyte Type
{ {
get { return m_metadata.Type; } get { return m_metadata.Type; }
set { m_metadata.Type = value; } set { m_metadata.Type = value; }
} }
/// <summary>
/// Is this a region only asset, or does this exist on the asset server also
/// </summary>
public bool Local public bool Local
{ {
get { return m_metadata.Local; } get { return m_metadata.Local; }
set { m_metadata.Local = value; } set { m_metadata.Local = value; }
} }
/// <summary>
/// Is this asset going to be saved to the asset database?
/// </summary>
public bool Temporary public bool Temporary
{ {
get { return m_metadata.Temporary; } get { return m_metadata.Temporary; }

View File

@ -28,14 +28,13 @@
using System; using System;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Runtime.Serialization;
using System.Security.Permissions;
using OpenMetaverse; using OpenMetaverse;
using log4net;
using System.Reflection;
namespace OpenSim.Framework namespace OpenSim.Framework
{ {
/// <summary>
/// Contains the Avatar's Appearance and methods to manipulate the appearance.
/// </summary>
public class AvatarAppearance public class AvatarAppearance
{ {
//private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);

View File

@ -29,10 +29,24 @@ using OpenMetaverse;
namespace OpenSim.Framework namespace OpenSim.Framework
{ {
/// <summary>
/// Avatar returned by the Avatar Picker request
/// </summary>
public class AvatarPickerAvatar public class AvatarPickerAvatar
{ {
/// <summary>
/// Avatar's Unique ID
/// </summary>
public UUID AvatarID; public UUID AvatarID;
/// <summary>
/// Avatar's Account first name
/// </summary>
public string firstName; public string firstName;
/// <summary>
/// Avatar's Account last name
/// </summary>
public string lastName; public string lastName;
} }
} }

View File

@ -30,9 +30,19 @@ using OpenMetaverse;
namespace OpenSim.Framework namespace OpenSim.Framework
{ {
/// <summary>
/// Args to return to a client that queries picker data
/// </summary>
public class AvatarPickerReplyAgentDataArgs : EventArgs public class AvatarPickerReplyAgentDataArgs : EventArgs
{ {
/// <summary>
/// Unique Agent ID
/// </summary>
public UUID AgentID; public UUID AgentID;
/// <summary>
/// ID of query user submitted
/// </summary>
public UUID QueryID; public UUID QueryID;
} }
} }

View File

@ -45,6 +45,9 @@ namespace OpenSim.Framework
get { return m_cultureInfo; } get { return m_cultureInfo; }
} }
/// <summary>
/// Set Culture to en-US to make string processing of numbers simpler.
/// </summary>
public static void SetCurrentCulture() public static void SetCurrentCulture()
{ {
Thread.CurrentThread.CurrentCulture = m_cultureInfo; Thread.CurrentThread.CurrentCulture = m_cultureInfo;

View File

@ -31,6 +31,9 @@ using OpenMetaverse;
namespace OpenSim.Framework namespace OpenSim.Framework
{ {
/// <summary>
/// Details of a Parcel of land
/// </summary>
public class LandData public class LandData
{ {
private Vector3 _AABBMax = new Vector3(); private Vector3 _AABBMax = new Vector3();

View File

@ -443,7 +443,7 @@ namespace OpenSim.Framework.Servers
string inputLine; string inputLine;
int strcmp; int strcmp;
if (File.Exists( gitCommitFileName)) if (File.Exists(gitCommitFileName))
{ {
StreamReader CommitFile = File.OpenText(gitCommitFileName); StreamReader CommitFile = File.OpenText(gitCommitFileName);
buildVersion = Environment.NewLine + "git# " + CommitFile.ReadLine(); buildVersion = Environment.NewLine + "git# " + CommitFile.ReadLine();

View File

@ -36,25 +36,47 @@ using OpenSim.Framework.Console;
namespace OpenSim namespace OpenSim
{ {
/// <summary>
/// Starting class for the OpenSimulator Region
/// </summary>
public class Application public class Application
{ {
/// <summary>
/// Text Console Logger
/// </summary>
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
/// <summary>
/// Path to the main ini Configuration file
/// </summary>
public static string iniFilePath = ""; public static string iniFilePath = "";
/// <summary>
/// Save Crashes in the bin/crashes folder. Configurable with m_crashDir
/// </summary>
public static bool m_saveCrashDumps = false; public static bool m_saveCrashDumps = false;
/// <summary>
/// Directory to save crash reports to. Relative to bin/
/// </summary>
public static string m_crashDir = "crashes"; public static string m_crashDir = "crashes";
/// <summary>
/// Instance of the OpenSim class. This could be OpenSim or OpenSimBackground depending on the configuration
/// </summary>
protected static OpenSimBase m_sim = null; protected static OpenSimBase m_sim = null;
//could move our main function into OpenSimMain and kill this class //could move our main function into OpenSimMain and kill this class
public static void Main(string[] args) public static void Main(string[] args)
{ {
// First line // First line, hook the appdomain to the crash reporter
AppDomain.CurrentDomain.UnhandledException += AppDomain.CurrentDomain.UnhandledException +=
new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
// Add the arguments supplied when running the application to the configuration
ArgvConfigSource configSource = new ArgvConfigSource(args); ArgvConfigSource configSource = new ArgvConfigSource(args);
// Configure Log4Net
configSource.AddSwitch("Startup", "logconfig"); configSource.AddSwitch("Startup", "logconfig");
string logConfigFile = configSource.Configs["Startup"].GetString("logconfig", String.Empty); string logConfigFile = configSource.Configs["Startup"].GetString("logconfig", String.Empty);
if (logConfigFile != String.Empty) if (logConfigFile != String.Empty)
@ -69,6 +91,8 @@ namespace OpenSim
m_log.Info("[OPENSIM MAIN]: configured log4net using default OpenSim.exe.config"); 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... "); m_log.Info("Performing compatibility checks... ");
string supported = String.Empty; string supported = String.Empty;
if (Util.IsEnvironmentSupported(ref supported)) if (Util.IsEnvironmentSupported(ref supported))
@ -80,6 +104,7 @@ namespace OpenSim
m_log.Warn("Environment is unsupported (" + supported + ")\n"); m_log.Warn("Environment is unsupported (" + supported + ")\n");
} }
// Configure nIni aliases and localles
Culture.SetCurrentCulture(); Culture.SetCurrentCulture();
@ -99,8 +124,13 @@ namespace OpenSim
configSource.AddConfig("StandAlone"); configSource.AddConfig("StandAlone");
configSource.AddConfig("Network"); configSource.AddConfig("Network");
// Check if we're running in the background or not
bool background = configSource.Configs["Startup"].GetBoolean("background", false); bool background = configSource.Configs["Startup"].GetBoolean("background", false);
// Check if we're saving crashes
m_saveCrashDumps = configSource.Configs["Startup"].GetBoolean("save_crashes", false); m_saveCrashDumps = configSource.Configs["Startup"].GetBoolean("save_crashes", false);
// load Crash directory config
m_crashDir = configSource.Configs["Startup"].GetString("crash_dir", m_crashDir); m_crashDir = configSource.Configs["Startup"].GetString("crash_dir", m_crashDir);
if (background) if (background)
@ -118,6 +148,7 @@ namespace OpenSim
{ {
try try
{ {
// Block thread here for input
MainConsole.Instance.Prompt(); MainConsole.Instance.Prompt();
} }
catch (Exception e) catch (Exception e)

View File

@ -37,12 +37,32 @@ using OpenSim.Framework;
namespace OpenSim namespace OpenSim
{ {
/// <summary>
/// Loads the Configuration files into nIni
/// </summary>
public class ConfigurationLoader public class ConfigurationLoader
{ {
/// <summary>
/// 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.
/// </summary>
protected ConfigSettings m_configSettings; protected ConfigSettings m_configSettings;
/// <summary>
/// A source of Configuration data
/// </summary>
protected OpenSimConfigSource m_config; protected OpenSimConfigSource m_config;
/// <summary>
/// Grid Service Information. This refers to classes and addresses of the grid service
/// </summary>
protected NetworkServersInfo m_networkServersInfo; protected NetworkServersInfo m_networkServersInfo;
/// <summary>
/// Console logger
/// </summary>
private static readonly ILog m_log = private static readonly ILog m_log =
LogManager.GetLogger( LogManager.GetLogger(
MethodBase.GetCurrentMethod().DeclaringType); MethodBase.GetCurrentMethod().DeclaringType);
@ -51,6 +71,13 @@ namespace OpenSim
{ {
} }
/// <summary>
/// Loads the region configuration
/// </summary>
/// <param name="argvSource">Parameters passed into the process when started</param>
/// <param name="configSettings"></param>
/// <param name="networkInfo"></param>
/// <returns>A configuration that gets passed to modules</returns>
public OpenSimConfigSource LoadConfigSettings( public OpenSimConfigSource LoadConfigSettings(
IConfigSource argvSource, out ConfigSettings configSettings, IConfigSource argvSource, out ConfigSettings configSettings,
out NetworkServersInfo networkInfo) out NetworkServersInfo networkInfo)
@ -169,15 +196,22 @@ namespace OpenSim
return m_config; return m_config;
} }
/// <summary>
/// Adds the included files as ini configuration files
/// </summary>
/// <param name="sources">List of URL strings or filename strings</param>
private void AddIncludes(List<string> sources) private void AddIncludes(List<string> sources)
{ {
//loop over config sources
foreach (IConfig config in m_config.Source.Configs) foreach (IConfig config in m_config.Source.Configs)
{ {
// Look for Include-* in the key name
string[] keys = config.GetKeys(); string[] keys = config.GetKeys();
foreach (string k in keys) foreach (string k in keys)
{ {
if (k.StartsWith("Include-")) if (k.StartsWith("Include-"))
{ {
// read the config file to be included.
string file = config.GetString(k); string file = config.GetString(k);
if (IsUri(file)) if (IsUri(file))
{ {
@ -199,7 +233,11 @@ namespace OpenSim
} }
} }
} }
/// <summary>
/// Check if we can convert the string to a URI
/// </summary>
/// <param name="file">String uri to the remote resource</param>
/// <returns>true if we can convert the string to a Uri object</returns>
bool IsUri(string file) bool IsUri(string file)
{ {
Uri configUri; Uri configUri;
@ -253,7 +291,7 @@ namespace OpenSim
/// <summary> /// <summary>
/// Setup a default config values in case they aren't present in the ini file /// Setup a default config values in case they aren't present in the ini file
/// </summary> /// </summary>
/// <returns></returns> /// <returns>A Configuration source containing the default configuration</returns>
private static IConfigSource DefaultConfig() private static IConfigSource DefaultConfig()
{ {
IConfigSource defaultConfig = new IniConfigSource(); IConfigSource defaultConfig = new IniConfigSource();
@ -322,6 +360,9 @@ namespace OpenSim
return defaultConfig; return defaultConfig;
} }
/// <summary>
/// Read initial region settings from the ConfigSource
/// </summary>
protected virtual void ReadConfigSettings() protected virtual void ReadConfigSettings()
{ {
IConfig startupConfig = m_config.Source.Configs["Startup"]; IConfig startupConfig = m_config.Source.Configs["Startup"];

View File

@ -29,12 +29,24 @@ using OpenSim.Framework;
namespace OpenSim namespace OpenSim
{ {
/// <summary>
/// OpenSimulator Application Plugin framework interface
/// </summary>
public interface IApplicationPlugin : IPlugin public interface IApplicationPlugin : IPlugin
{ {
/// <summary>
/// Initialize the Plugin
/// </summary>
/// <param name="openSim">The Application instance</param>
void Initialise(OpenSimBase openSim); void Initialise(OpenSimBase openSim);
/// <summary>
/// Called when the application loading is completed
/// </summary>
void PostInitialise(); void PostInitialise();
} }
public class ApplicationPluginInitialiser : PluginInitialiserBase public class ApplicationPluginInitialiser : PluginInitialiserBase
{ {
private OpenSimBase server; private OpenSimBase server;

View File

@ -146,6 +146,9 @@ namespace OpenSim
ChangeSelectedRegion("region", new string[] {"change", "region", "root"}); ChangeSelectedRegion("region", new string[] {"change", "region", "root"});
} }
/// <summary>
/// Register standard set of region console commands
/// </summary>
private void RegisterConsoleCommands() private void RegisterConsoleCommands()
{ {
m_console.Commands.AddCommand("region", false, "clear assets", m_console.Commands.AddCommand("region", false, "clear assets",
@ -332,6 +335,11 @@ namespace OpenSim
base.ShutdownSpecific(); base.ShutdownSpecific();
} }
/// <summary>
/// Timer to run a specific text file as console commands. Configured in in the main ini file
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void RunAutoTimerScript(object sender, EventArgs e) private void RunAutoTimerScript(object sender, EventArgs e)
{ {
if (m_timedScript != "disabled") if (m_timedScript != "disabled")
@ -342,6 +350,11 @@ namespace OpenSim
#region Console Commands #region Console Commands
/// <summary>
/// Kicks users off the region
/// </summary>
/// <param name="module"></param>
/// <param name="cmdparams">name of avatar to kick</param>
private void KickUserCommand(string module, string[] cmdparams) private void KickUserCommand(string module, string[] cmdparams)
{ {
if (cmdparams.Length < 4) if (cmdparams.Length < 4)
@ -401,6 +414,10 @@ namespace OpenSim
} }
} }
/// <summary>
/// Opens a file and uses it as input to the console command parser.
/// </summary>
/// <param name="fileName">name of file to use as input to the console</param>
private static void PrintFileToConsole(string fileName) private static void PrintFileToConsole(string fileName)
{ {
if (File.Exists(fileName)) if (File.Exists(fileName))
@ -419,12 +436,22 @@ namespace OpenSim
m_log.Info("Not implemented."); m_log.Info("Not implemented.");
} }
/// <summary>
/// Force resending of all updates to all clients in active region(s)
/// </summary>
/// <param name="module"></param>
/// <param name="args"></param>
private void HandleForceUpdate(string module, string[] args) private void HandleForceUpdate(string module, string[] args)
{ {
m_log.Info("Updating all clients"); m_log.Info("Updating all clients");
m_sceneManager.ForceCurrentSceneClientUpdate(); m_sceneManager.ForceCurrentSceneClientUpdate();
} }
/// <summary>
/// Edits the scale of a primative with the name specified
/// </summary>
/// <param name="module"></param>
/// <param name="args">0,1, name, x, y, z</param>
private void HandleEditScale(string module, string[] args) private void HandleEditScale(string module, string[] args)
{ {
if (args.Length == 6) if (args.Length == 6)
@ -437,6 +464,11 @@ namespace OpenSim
} }
} }
/// <summary>
/// Creates a new region based on the parameters specified. This will ask the user questions on the console
/// </summary>
/// <param name="module"></param>
/// <param name="cmd">0,1,region name, region XML file</param>
private void HandleCreateRegion(string module, string[] cmd) private void HandleCreateRegion(string module, string[] cmd)
{ {
if (cmd.Length < 4) if (cmd.Length < 4)
@ -473,16 +505,32 @@ namespace OpenSim
} }
} }
/// <summary>
/// Enable logins
/// </summary>
/// <param name="module"></param>
/// <param name="cmd"></param>
private void HandleLoginEnable(string module, string[] cmd) private void HandleLoginEnable(string module, string[] cmd)
{ {
ProcessLogin(true); ProcessLogin(true);
} }
/// <summary>
/// Disable logins
/// </summary>
/// <param name="module"></param>
/// <param name="cmd"></param>
private void HandleLoginDisable(string module, string[] cmd) private void HandleLoginDisable(string module, string[] cmd)
{ {
ProcessLogin(false); ProcessLogin(false);
} }
/// <summary>
/// Log login status to the console
/// </summary>
/// <param name="module"></param>
/// <param name="cmd"></param>
private void HandleLoginStatus(string module, string[] cmd) private void HandleLoginStatus(string module, string[] cmd)
{ {
if (m_commsManager.GridService.RegionLoginsEnabled == false) if (m_commsManager.GridService.RegionLoginsEnabled == false)
@ -492,6 +540,12 @@ namespace OpenSim
m_log.Info("[ Login ] Login are enabled"); m_log.Info("[ Login ] Login are enabled");
} }
/// <summary>
/// Change and load configuration file data.
/// </summary>
/// <param name="module"></param>
/// <param name="cmd"></param>
private void HandleConfig(string module, string[] cmd) private void HandleConfig(string module, string[] cmd)
{ {
List<string> args = new List<string>(cmd); List<string> args = new List<string>(cmd);
@ -557,6 +611,12 @@ namespace OpenSim
} }
} }
/// <summary>
/// Load, Unload, and list Region modules in use
/// </summary>
/// <param name="module"></param>
/// <param name="cmd"></param>
private void HandleModules(string module, string[] cmd) private void HandleModules(string module, string[] cmd)
{ {
List<string> args = new List<string>(cmd); List<string> args = new List<string>(cmd);
@ -797,6 +857,11 @@ namespace OpenSim
} }
// see BaseOpenSimServer // see BaseOpenSimServer
/// <summary>
/// Many commands list objects for debugging. Some of the types are listed here
/// </summary>
/// <param name="mod"></param>
/// <param name="cmd"></param>
public override void HandleShow(string mod, string[] cmd) public override void HandleShow(string mod, string[] cmd)
{ {
base.HandleShow(mod, cmd); base.HandleShow(mod, cmd);
@ -902,6 +967,10 @@ namespace OpenSim
} }
} }
/// <summary>
/// print UDP Queue data for each client
/// </summary>
/// <returns></returns>
private string GetQueuesReport() private string GetQueuesReport()
{ {
string report = String.Empty; string report = String.Empty;
@ -1010,6 +1079,11 @@ namespace OpenSim
m_commsManager.UserAdminService.ResetUserPassword(firstName, lastName, newPassword); m_commsManager.UserAdminService.ResetUserPassword(firstName, lastName, newPassword);
} }
/// <summary>
/// Use XML2 format to serialize data to a file
/// </summary>
/// <param name="module"></param>
/// <param name="cmdparams"></param>
protected void SavePrimsXml2(string module, string[] cmdparams) protected void SavePrimsXml2(string module, string[] cmdparams)
{ {
if (cmdparams.Length > 5) if (cmdparams.Length > 5)
@ -1022,6 +1096,11 @@ namespace OpenSim
} }
} }
/// <summary>
/// Use XML format to serialize data to a file
/// </summary>
/// <param name="module"></param>
/// <param name="cmdparams"></param>
protected void SaveXml(string module, string[] cmdparams) 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."); 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
} }
} }
/// <summary>
/// Loads data and region objects from XML format.
/// </summary>
/// <param name="module"></param>
/// <param name="cmdparams"></param>
protected void LoadXml(string module, string[] cmdparams) 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."); 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
} }
} }
} }
/// <summary>
/// Serialize region data to XML2Format
/// </summary>
/// <param name="module"></param>
/// <param name="cmdparams"></param>
protected void SaveXml2(string module, string[] cmdparams) protected void SaveXml2(string module, string[] cmdparams)
{ {
if (cmdparams.Length > 2) if (cmdparams.Length > 2)
@ -1092,6 +1180,11 @@ namespace OpenSim
} }
} }
/// <summary>
/// Load region data from Xml2Format
/// </summary>
/// <param name="module"></param>
/// <param name="cmdparams"></param>
protected void LoadXml2(string module, string[] cmdparams) protected void LoadXml2(string module, string[] cmdparams)
{ {
if (cmdparams.Length > 2) if (cmdparams.Length > 2)

View File

@ -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.Collections.Generic;
using OpenMetaverse; using OpenMetaverse;

View File

@ -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.Collections.Generic;
using System.Reflection; using System.Reflection;

View File

@ -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.Collections.Generic;
using System.Text; using System.Text;
using OpenSim.Framework; using OpenSim.Framework;