From 375163a6fece8b3a57c7555246abe8338223a599 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Tue, 29 Apr 2008 14:04:55 +0000 Subject: * Spring cleaning. * Added new generic "Location" class to handle 2D integer locations. Going to use it to replace all RegionHandle and X,Y coordinate references throughout the entire project. You have been warned. --- OpenSim/Framework/ACL.cs | 42 ++-- OpenSim/Framework/AgentCircuitData.cs | 52 ++-- OpenSim/Framework/AgentInventory.cs | 20 +- OpenSim/Framework/AssemblyInfo.cs | 2 +- OpenSim/Framework/AssetBase.cs | 37 +-- OpenSim/Framework/AssetConfig.cs | 13 +- OpenSim/Framework/AssetLandmark.cs | 6 +- OpenSim/Framework/AssetRequest.cs | 2 +- OpenSim/Framework/AssetStorage.cs | 12 +- OpenSim/Framework/AuthenticateResponse.cs | 2 +- OpenSim/Framework/AvatarPickerAvatar.cs | 2 +- OpenSim/Framework/AvatarWearable.cs | 34 +-- OpenSim/Framework/BlockingQueue.cs | 12 +- OpenSim/Framework/ChildAgentDataUpdate.cs | 28 +-- OpenSim/Framework/ClientManager.cs | 24 +- OpenSim/Framework/ConfigurationMember.cs | 30 ++- OpenSim/Framework/ConfigurationOption.cs | 13 +- OpenSim/Framework/Constants.cs | 2 +- OpenSim/Framework/Culture.cs | 2 +- OpenSim/Framework/EstateSettings.cs | 221 ++++++++--------- OpenSim/Framework/FriendListItem.cs | 6 +- OpenSim/Framework/GridConfig.cs | 29 +-- OpenSim/Framework/GridInstantMessage.cs | 17 +- OpenSim/Framework/IAssetLoader.cs | 4 +- OpenSim/Framework/IAssetProvider.cs | 2 +- OpenSim/Framework/IAssetServer.cs | 4 +- OpenSim/Framework/IClientAPI.cs | 156 ++++++------ OpenSim/Framework/IGenericConfig.cs | 2 +- OpenSim/Framework/IInventoryData.cs | 6 +- OpenSim/Framework/IPlugin.cs | 2 +- OpenSim/Framework/IRegionCommsListener.cs | 2 +- OpenSim/Framework/IRegionLoader.cs | 2 +- OpenSim/Framework/IScene.cs | 20 +- OpenSim/Framework/IUserData.cs | 3 +- OpenSim/Framework/IUserService.cs | 8 +- OpenSim/Framework/InventoryCollection.cs | 2 +- OpenSim/Framework/InventoryConfig.cs | 60 +++-- OpenSim/Framework/InventoryFolderBase.cs | 80 +++---- OpenSim/Framework/InventoryItemBase.cs | 197 +++++++--------- OpenSim/Framework/JId.cs | 9 +- OpenSim/Framework/LandData.cs | 35 ++- OpenSim/Framework/Login.cs | 14 +- OpenSim/Framework/MapBlockData.cs | 12 +- OpenSim/Framework/MessageServerConfig.cs | 60 +++-- OpenSim/Framework/NeighbourInfo.cs | 10 +- OpenSim/Framework/NetworkServersInfo.cs | 31 +-- OpenSim/Framework/OSUUID.cs | 44 ++-- OpenSim/Framework/PacketPool.cs | 76 +++--- OpenSim/Framework/PrimitiveBaseShape.cs | 4 +- OpenSim/Framework/RegionCommsListener.cs | 33 +-- OpenSim/Framework/RegionHandle.cs | 2 +- OpenSim/Framework/RegionInfo.cs | 148 ++++++------ OpenSim/Framework/RegionUpData.cs | 12 +- OpenSim/Framework/Remoting.cs | 4 +- OpenSim/Framework/SerializableInventory.cs | 14 +- OpenSim/Framework/SerializableRegionInfo.cs | 98 +++----- OpenSim/Framework/TaskInventoryItem.cs | 225 +++++++++--------- OpenSim/Framework/ThreadTracker.cs | 10 +- OpenSim/Framework/UndoStack.cs | 44 ++-- OpenSim/Framework/UserAgentData.cs | 192 +++++++-------- OpenSim/Framework/UserConfig.cs | 26 +- OpenSim/Framework/UserProfileData.cs | 354 ++++++++++++---------------- OpenSim/Framework/Util.cs | 65 +++-- OpenSim/Framework/sLLVector3.cs | 10 +- 64 files changed, 1249 insertions(+), 1441 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Framework/ACL.cs b/OpenSim/Framework/ACL.cs index 88a3034..29d7f7a 100644 --- a/OpenSim/Framework/ACL.cs +++ b/OpenSim/Framework/ACL.cs @@ -43,8 +43,8 @@ namespace OpenSim.Framework /// public class ACL { - private Dictionary Roles = new Dictionary(); private Dictionary Resources = new Dictionary(); + private Dictionary Roles = new Dictionary(); public ACL AddRole(Role role) { @@ -125,14 +125,14 @@ namespace OpenSim.Framework { protected Role m_role; - public Role ErrorRole + public AlreadyContainsRoleException(Role role) { - get { return m_role; } + m_role = role; } - public AlreadyContainsRoleException(Role role) + public Role ErrorRole { - m_role = role; + get { return m_role; } } public override string ToString() @@ -164,6 +164,18 @@ namespace OpenSim.Framework private Role[] m_parents; private Dictionary m_resources = new Dictionary(); + public Role(string name) + { + m_name = name; + m_parents = null; + } + + public Role(string name, Role[] parents) + { + m_name = name; + m_parents = parents; + } + public string Name { get { return m_name; } @@ -201,32 +213,20 @@ namespace OpenSim.Framework { m_resources[resource] = perm; } - - public Role(string name) - { - m_name = name; - m_parents = null; - } - - public Role(string name, Role[] parents) - { - m_name = name; - m_parents = parents; - } } public class Resource { private string m_name; - public string Name + public Resource(string name) { - get { return m_name; } + m_name = name; } - public Resource(string name) + public string Name { - m_name = name; + get { return m_name; } } } diff --git a/OpenSim/Framework/AgentCircuitData.cs b/OpenSim/Framework/AgentCircuitData.cs index a8cbaf0..8c184c4 100644 --- a/OpenSim/Framework/AgentCircuitData.cs +++ b/OpenSim/Framework/AgentCircuitData.cs @@ -32,6 +32,18 @@ namespace OpenSim.Framework { public class AgentCircuitData { + public LLUUID AgentID; + public LLUUID BaseFolder; + public string CapsPath = String.Empty; + public bool child; + public uint circuitcode; + public string firstname; + public LLUUID InventoryFolder; + public string lastname; + public LLUUID SecureSessionID; + public LLUUID SessionID; + public LLVector3 startpos; + public AgentCircuitData() { } @@ -50,23 +62,25 @@ namespace OpenSim.Framework BaseFolder = new LLUUID(cAgent.BaseFolder); CapsPath = cAgent.CapsPath; } - - public LLUUID AgentID; - public LLUUID SessionID; - public LLUUID SecureSessionID; - public LLVector3 startpos; - public string firstname; - public string lastname; - public uint circuitcode; - public bool child; - public LLUUID InventoryFolder; - public LLUUID BaseFolder; - public string CapsPath = String.Empty; } [Serializable] public class sAgentCircuitData { + public Guid AgentID; + public Guid BaseFolder; + public string CapsPath = String.Empty; + public bool child; + public uint circuitcode; + public string firstname; + public Guid InventoryFolder; + public string lastname; + public Guid SecureSessionID; + public Guid SessionID; + public float startposx; + public float startposy; + public float startposz; + public sAgentCircuitData() { } @@ -87,19 +101,5 @@ namespace OpenSim.Framework BaseFolder = cAgent.BaseFolder.UUID; CapsPath = cAgent.CapsPath; } - - public Guid AgentID; - public Guid SessionID; - public Guid SecureSessionID; - public float startposx; - public float startposy; - public float startposz; - public string firstname; - public string lastname; - public uint circuitcode; - public bool child; - public Guid InventoryFolder; - public Guid BaseFolder; - public string CapsPath = String.Empty; } } \ No newline at end of file diff --git a/OpenSim/Framework/AgentInventory.cs b/OpenSim/Framework/AgentInventory.cs index ef3ad16..61e8636 100644 --- a/OpenSim/Framework/AgentInventory.cs +++ b/OpenSim/Framework/AgentInventory.cs @@ -35,11 +35,11 @@ namespace OpenSim.Framework public class AgentInventory { //Holds the local copy of Inventory info for a agent + public LLUUID AgentID; public Dictionary InventoryFolders; public Dictionary InventoryItems; public InventoryFolder InventoryRoot; public int LastCached; //maybe used by opensim app, time this was last stored/compared to user server - public LLUUID AgentID; public AvatarWearable[] Wearables; public AgentInventory() @@ -206,13 +206,13 @@ namespace OpenSim.Framework public class InventoryFolder { - public List Items; //public List Subfolders; + public ushort DefaultType; public LLUUID FolderID; + public string FolderName; + public List Items; public LLUUID OwnerID; public LLUUID ParentID = LLUUID.Zero; - public string FolderName; - public ushort DefaultType; public ushort Version; public InventoryFolder() @@ -224,15 +224,15 @@ namespace OpenSim.Framework public class InventoryItem { - public LLUUID FolderID; - public LLUUID OwnerID; - public LLUUID ItemID; public LLUUID AssetID; public LLUUID CreatorID; + public string Description; + public LLUUID FolderID; public sbyte InvType; - public sbyte Type; + public LLUUID ItemID; public string Name = String.Empty; - public string Description; + public LLUUID OwnerID; + public sbyte Type; public InventoryItem() { @@ -252,4 +252,4 @@ namespace OpenSim.Framework return result; } } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/AssemblyInfo.cs b/OpenSim/Framework/AssemblyInfo.cs index 8f86936..d43b259 100644 --- a/OpenSim/Framework/AssemblyInfo.cs +++ b/OpenSim/Framework/AssemblyInfo.cs @@ -60,4 +60,4 @@ using System.Runtime.InteropServices; // [assembly : AssemblyVersion("1.0.0.0")] -[assembly : AssemblyFileVersion("1.0.0.0")] +[assembly : AssemblyFileVersion("1.0.0.0")] \ No newline at end of file diff --git a/OpenSim/Framework/AssetBase.cs b/OpenSim/Framework/AssetBase.cs index ab09ac3..29d996b 100644 --- a/OpenSim/Framework/AssetBase.cs +++ b/OpenSim/Framework/AssetBase.cs @@ -34,13 +34,13 @@ namespace OpenSim.Framework public class AssetBase { private byte[] _data; + private string _description = String.Empty; private LLUUID _fullid; - private sbyte _type; private sbyte _invtype; - private string _name = String.Empty; - private string _description = String.Empty; private bool _local = false; + private string _name = String.Empty; private bool _temporary = false; + private sbyte _type; public AssetBase() { @@ -52,49 +52,58 @@ namespace OpenSim.Framework Name = name; } - public virtual LLUUID FullID { + public virtual LLUUID FullID + { get { return _fullid; } set { _fullid = value; } } - public virtual string ID { + public virtual string ID + { get { return _fullid.ToString(); } set { _fullid = new LLUUID(value); } } - - public virtual byte[] Data { + + public virtual byte[] Data + { get { return _data; } set { _data = value; } } - public virtual sbyte Type { + public virtual sbyte Type + { get { return _type; } set { _type = value; } } - public virtual sbyte InvType { + public virtual sbyte InvType + { get { return _invtype; } set { _invtype = value; } } - public virtual string Name { + public virtual string Name + { get { return _name; } set { _name = value; } } - public virtual string Description { + public virtual string Description + { get { return _description; } set { _description = value; } } - public virtual bool Local { + public virtual bool Local + { get { return _local; } set { _local = value; } } - public virtual bool Temporary { + public virtual bool Temporary + { get { return _temporary; } set { _temporary = value; } } } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/AssetConfig.cs b/OpenSim/Framework/AssetConfig.cs index 85dbaa6..dc73f37 100644 --- a/OpenSim/Framework/AssetConfig.cs +++ b/OpenSim/Framework/AssetConfig.cs @@ -34,16 +34,13 @@ namespace OpenSim.Framework /// public class AssetConfig { - public string DefaultStartupMsg = String.Empty; - - public string DatabaseProvider = String.Empty; - - public string DatabaseConnect = String.Empty; - public const uint DefaultHttpPort = 8003; - public uint HttpPort = DefaultHttpPort; private ConfigurationMember configMember; + public string DatabaseConnect = String.Empty; + public string DatabaseProvider = String.Empty; + public string DefaultStartupMsg = String.Empty; + public uint HttpPort = DefaultHttpPort; public AssetConfig(string description, string filename) { @@ -89,4 +86,4 @@ namespace OpenSim.Framework return true; } } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/AssetLandmark.cs b/OpenSim/Framework/AssetLandmark.cs index f322636..de3028b 100644 --- a/OpenSim/Framework/AssetLandmark.cs +++ b/OpenSim/Framework/AssetLandmark.cs @@ -32,10 +32,10 @@ namespace OpenSim.Framework { public class AssetLandmark : AssetBase { - public int Version; public LLVector3 Position; - public LLUUID RegionID; public ulong RegionHandle; + public LLUUID RegionID; + public int Version; public AssetLandmark(AssetBase a) { @@ -58,4 +58,4 @@ namespace OpenSim.Framework ulong.TryParse(parts[3].Substring(14, parts[3].Length - 14), out RegionHandle); } } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/AssetRequest.cs b/OpenSim/Framework/AssetRequest.cs index 86808f4..71d5298 100644 --- a/OpenSim/Framework/AssetRequest.cs +++ b/OpenSim/Framework/AssetRequest.cs @@ -34,4 +34,4 @@ namespace OpenSim.Framework public LLUUID AssetID; public bool IsTexture; } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/AssetStorage.cs b/OpenSim/Framework/AssetStorage.cs index 9c0f52c..d58d866 100644 --- a/OpenSim/Framework/AssetStorage.cs +++ b/OpenSim/Framework/AssetStorage.cs @@ -31,6 +31,11 @@ namespace OpenSim.Framework { public class AssetStorage { + public byte[] Data; + public string Name; + public sbyte Type; + public LLUUID UUID; + public AssetStorage() { } @@ -39,10 +44,5 @@ namespace OpenSim.Framework { UUID = assetUUID; } - - public byte[] Data; - public sbyte Type; - public string Name; - public LLUUID UUID; } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/AuthenticateResponse.cs b/OpenSim/Framework/AuthenticateResponse.cs index f7319d1..b652c01 100644 --- a/OpenSim/Framework/AuthenticateResponse.cs +++ b/OpenSim/Framework/AuthenticateResponse.cs @@ -36,4 +36,4 @@ namespace OpenSim.Framework { } } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/AvatarPickerAvatar.cs b/OpenSim/Framework/AvatarPickerAvatar.cs index 26a5bb2..a7e986f 100644 --- a/OpenSim/Framework/AvatarPickerAvatar.cs +++ b/OpenSim/Framework/AvatarPickerAvatar.cs @@ -35,4 +35,4 @@ namespace OpenSim.Framework public string firstName; public string lastName; } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/AvatarWearable.cs b/OpenSim/Framework/AvatarWearable.cs index cd5f7f6..fdcc776 100644 --- a/OpenSim/Framework/AvatarWearable.cs +++ b/OpenSim/Framework/AvatarWearable.cs @@ -48,6 +48,20 @@ namespace OpenSim.Framework ItemID = itemId; } + protected AvatarWearable(SerializationInfo info, StreamingContext context) + { + //System.Console.WriteLine("AvatarWearable Deserialize BGN"); + if (info == null) + { + throw new ArgumentNullException("info"); + } + + AssetID = new LLUUID((Guid) info.GetValue("AssetID", typeof (Guid))); + ItemID = new LLUUID((Guid) info.GetValue("ItemID", typeof (Guid))); + + //System.Console.WriteLine("AvatarWearable Deserialize END"); + } + public static AvatarWearable[] DefaultWearables { get @@ -72,24 +86,12 @@ namespace OpenSim.Framework } } - protected AvatarWearable(SerializationInfo info, StreamingContext context) - { - //System.Console.WriteLine("AvatarWearable Deserialize BGN"); - if (info == null) - { - throw new ArgumentNullException("info"); - } - - AssetID = new LLUUID((Guid)info.GetValue("AssetID", typeof(Guid))); - ItemID = new LLUUID((Guid)info.GetValue("ItemID", typeof(Guid))); - - //System.Console.WriteLine("AvatarWearable Deserialize END"); - } + #region ISerializable Members [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.SerializationFormatter)] public virtual void GetObjectData( - SerializationInfo info, StreamingContext context) + SerializationInfo info, StreamingContext context) { if (info == null) { @@ -99,5 +101,7 @@ namespace OpenSim.Framework info.AddValue("AssetID", AssetID.UUID); info.AddValue("ItemID", ItemID.UUID); } + + #endregion } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/BlockingQueue.cs b/OpenSim/Framework/BlockingQueue.cs index dbb3d84..345b361 100644 --- a/OpenSim/Framework/BlockingQueue.cs +++ b/OpenSim/Framework/BlockingQueue.cs @@ -64,13 +64,13 @@ namespace OpenSim.Framework return m_queue.Contains(item); } } - + public int Count() { - lock(m_queueSync) - { - return m_queue.Count; - } + lock (m_queueSync) + { + return m_queue.Count; + } } public T[] GetQueueArray() @@ -81,4 +81,4 @@ namespace OpenSim.Framework } } } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/ChildAgentDataUpdate.cs b/OpenSim/Framework/ChildAgentDataUpdate.cs index 8706f8d..423a208 100644 --- a/OpenSim/Framework/ChildAgentDataUpdate.cs +++ b/OpenSim/Framework/ChildAgentDataUpdate.cs @@ -32,21 +32,21 @@ namespace OpenSim.Framework [Serializable] public class ChildAgentDataUpdate { - public ChildAgentDataUpdate() - { - } - - public sLLVector3 Position; - public ulong regionHandle; - public float drawdistance; - public sLLVector3 cameraPosition; - public sLLVector3 Velocity; - public float AVHeight; + public Guid ActiveGroupID; public Guid AgentID; - public float godlevel; - public byte[] throttles; public bool alwaysrun; - public Guid ActiveGroupID; + public float AVHeight; + public sLLVector3 cameraPosition; + public float drawdistance; + public float godlevel; public uint GroupAccess; + public sLLVector3 Position; + public ulong regionHandle; + public byte[] throttles; + public sLLVector3 Velocity; + + public ChildAgentDataUpdate() + { + } } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/ClientManager.cs b/OpenSim/Framework/ClientManager.cs index 160d5b6..35c9319 100644 --- a/OpenSim/Framework/ClientManager.cs +++ b/OpenSim/Framework/ClientManager.cs @@ -42,6 +42,11 @@ namespace OpenSim.Framework private Dictionary m_clients; + public ClientManager() + { + m_clients = new Dictionary(); + } + public void ForEachClient(ForEachClientDelegate whatToDo) { // Wasteful, I know @@ -65,11 +70,6 @@ namespace OpenSim.Framework } } - public ClientManager() - { - m_clients = new Dictionary(); - } - public void Remove(uint id) { //m_log.InfoFormat("[CLIENT]: Removing client with code {0}, current count {1}", id, m_clients.Count); @@ -94,7 +94,7 @@ namespace OpenSim.Framework bool tryGetRet = false; lock (m_clients) tryGetRet = m_clients.TryGetValue(circuitCode, out client); - if(tryGetRet) + if (tryGetRet) { client.InPacket(packet); } @@ -106,7 +106,7 @@ namespace OpenSim.Framework bool tryGetRet = false; lock (m_clients) tryGetRet = m_clients.TryGetValue(circuitCode, out client); - if (tryGetRet) + if (tryGetRet) { CloseAllCircuits(client.AgentId); } @@ -125,7 +125,7 @@ namespace OpenSim.Framework bool tryGetRet = false; lock (m_clients) tryGetRet = m_clients.TryGetValue(circuits[i], out client); - if(tryGetRet) + if (tryGetRet) { Remove(client.CircuitCode); client.Close(false); @@ -138,7 +138,7 @@ namespace OpenSim.Framework } } - public uint[] GetAllCircuits(LLUUID agentId) + public uint[] GetAllCircuits(LLUUID agentId) { List circuits = new List(); // Wasteful, I know @@ -149,7 +149,7 @@ namespace OpenSim.Framework m_clients.Values.CopyTo(LocalClients, 0); } - for (int i = 0; i < LocalClients.Length; i++ ) + for (int i = 0; i < LocalClients.Length; i++) { if (LocalClients[i].AgentId == agentId) { @@ -173,7 +173,7 @@ namespace OpenSim.Framework public void ViewerEffectHandler(IClientAPI sender, ViewerEffectPacket.EffectBlock[] effectBlock) { - ViewerEffectPacket packet = (ViewerEffectPacket) PacketPool.Instance.GetPacket(PacketType.ViewerEffect); + ViewerEffectPacket packet = (ViewerEffectPacket) PacketPool.Instance.GetPacket(PacketType.ViewerEffect); // TODO: don't create new blocks if recycling an old packet packet.Effect = effectBlock; @@ -205,4 +205,4 @@ namespace OpenSim.Framework } } } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/ConfigurationMember.cs b/OpenSim/Framework/ConfigurationMember.cs index 12590b4..91b87a5 100644 --- a/OpenSim/Framework/ConfigurationMember.cs +++ b/OpenSim/Framework/ConfigurationMember.cs @@ -39,26 +39,33 @@ namespace OpenSim.Framework { public class ConfigurationMember { - private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + #region Delegates public delegate bool ConfigurationOptionResult(string configuration_key, object configuration_result); public delegate void ConfigurationOptionsLoad(); - private List configurationOptions = new List(); - private string configurationFilename = String.Empty; + #endregion + + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + private int cE = 0; + private string configurationDescription = String.Empty; + private string configurationFilename = String.Empty; private XmlNode configurationFromXMLNode = null; - private ConfigurationOptionsLoad loadFunction; - private ConfigurationOptionResult resultFunction; - + private List configurationOptions = new List(); private IGenericConfig configurationPlugin = null; - private bool useConsoleToPromptOnError = true; + /// /// This is the default configuration DLL loaded /// private string configurationPluginFilename = "OpenSim.Framework.Configuration.XML.dll"; + private ConfigurationOptionsLoad loadFunction; + private ConfigurationOptionResult resultFunction; + + private bool useConsoleToPromptOnError = true; + public ConfigurationMember(string configuration_filename, string configuration_description, ConfigurationOptionsLoad load_function, ConfigurationOptionResult result_function, bool use_console_to_prompt_on_error) { @@ -150,7 +157,6 @@ namespace OpenSim.Framework } // TEMP - REMOVE - private int cE = 0; public void performConfigurationRetrieve() { if (cE > 1) @@ -162,14 +168,14 @@ namespace OpenSim.Framework if (loadFunction == null) { m_log.Error("Load Function for '" + configurationDescription + - "' is null. Refusing to run configuration."); + "' is null. Refusing to run configuration."); return; } if (resultFunction == null) { m_log.Error("Result Function for '" + configurationDescription + - "' is null. Refusing to run configuration."); + "' is null. Refusing to run configuration."); return; } @@ -261,7 +267,7 @@ namespace OpenSim.Framework { console_result = MainConsole.Instance.CmdPrompt(configOption.configurationQuestion, - configOption.configurationDefault); + configOption.configurationDefault); } } else @@ -500,4 +506,4 @@ namespace OpenSim.Framework configurationPlugin.Close(); } } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/ConfigurationOption.cs b/OpenSim/Framework/ConfigurationOption.cs index b9919ca..9bb5d8f 100644 --- a/OpenSim/Framework/ConfigurationOption.cs +++ b/OpenSim/Framework/ConfigurationOption.cs @@ -31,8 +31,14 @@ namespace OpenSim.Framework { public class ConfigurationOption { + #region Delegates + public delegate bool ConfigurationOptionShouldBeAsked(string configuration_key); + #endregion + + #region ConfigurationTypes enum + public enum ConfigurationTypes { TYPE_STRING, @@ -53,12 +59,15 @@ namespace OpenSim.Framework TYPE_DOUBLE } ; + #endregion + + public string configurationDefault = String.Empty; + public string configurationKey = String.Empty; public string configurationQuestion = String.Empty; - public string configurationDefault = String.Empty; public ConfigurationTypes configurationType = ConfigurationTypes.TYPE_STRING; public bool configurationUseDefaultNoPrompt = false; public ConfigurationOptionShouldBeAsked shouldIBeAsked; //Should I be asked now? Based on previous answers } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/Constants.cs b/OpenSim/Framework/Constants.cs index 66b0885..395b71d 100644 --- a/OpenSim/Framework/Constants.cs +++ b/OpenSim/Framework/Constants.cs @@ -32,4 +32,4 @@ namespace OpenSim.Framework public const uint RegionSize = 256; public const byte TerrainPatchSize = 16; } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/Culture.cs b/OpenSim/Framework/Culture.cs index 1102060..bf4eec4 100644 --- a/OpenSim/Framework/Culture.cs +++ b/OpenSim/Framework/Culture.cs @@ -50,4 +50,4 @@ namespace OpenSim.Framework Thread.CurrentThread.CurrentCulture = m_cultureInfo; } } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/EstateSettings.cs b/OpenSim/Framework/EstateSettings.cs index efb55fe..331d7c3 100644 --- a/OpenSim/Framework/EstateSettings.cs +++ b/OpenSim/Framework/EstateSettings.cs @@ -36,10 +36,72 @@ namespace OpenSim.Framework public class EstateSettings { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + private ConfigurationMember configMember; //Settings to this island private float m_billableFactor; + private uint m_estateID; + private LLUUID m_estateManager0; + private LLUUID m_estateManager1; + private LLUUID m_estateManager2; + private LLUUID m_estateManager3; + private LLUUID m_estateManager4; + private LLUUID m_estateManager5; + private LLUUID m_estateManager6; + private LLUUID m_estateManager7; + private LLUUID m_estateManager8; + private LLUUID m_estateManager9; + private string m_estateName; + private byte m_maxAgents; + private float m_objectBonusFactor; + + private uint m_parentEstateID; + private int m_pricePerMeter; + private int m_redirectGridX; + private int m_redirectGridY; + private bool m_regionAllowTerraform; + private Simulator.RegionFlags m_regionFlags; + private ushort m_regionWaterHeight; + private Simulator.SimAccess m_simAccess; + private float m_sunHour; + private LLVector3 m_sunPosition; + private LLUUID m_terrainBase0; + private LLUUID m_terrainBase1; + private LLUUID m_terrainBase2; + private LLUUID m_terrainBase3; + private LLUUID m_terrainDetail0; + private LLUUID m_terrainDetail1; + private LLUUID m_terrainDetail2; + private LLUUID m_terrainDetail3; + private string m_terrainFile; + private float m_terrainHeightRange0; + private float m_terrainHeightRange1; + private float m_terrainHeightRange2; + private float m_terrainHeightRange3; + private LLUUID m_terrainImageID; + private float m_terrainLowerLimit; + private double m_terrainMultiplier; + private float m_terrainRaiseLimit; + private float m_terrainStartHeight0; + private float m_terrainStartHeight1; + private float m_terrainStartHeight2; + private float m_terrainStartHeight3; + private bool m_useFixedSun; + private float m_waterHeight; + + public EstateSettings() + { + // Temporary hack to prevent multiple loadings. + if (configMember == null) + { + configMember = + new ConfigurationMember(Path.Combine(Util.configDir(), "estate_settings.xml"), "ESTATE SETTINGS", + loadConfigurationOptions, handleIncomingConfiguration, true); + configMember.performConfigurationRetrieve(); + } + } + public float billableFactor { get { return m_billableFactor; } @@ -50,8 +112,6 @@ namespace OpenSim.Framework } } - private uint m_estateID; - public uint estateID { get { return m_estateID; } @@ -62,8 +122,6 @@ namespace OpenSim.Framework } } - private uint m_parentEstateID; - public uint parentEstateID { get { return m_parentEstateID; } @@ -74,8 +132,6 @@ namespace OpenSim.Framework } } - private byte m_maxAgents; - public byte maxAgents { get { return m_maxAgents; } @@ -86,8 +142,6 @@ namespace OpenSim.Framework } } - private float m_objectBonusFactor; - public float objectBonusFactor { get { return m_objectBonusFactor; } @@ -98,8 +152,6 @@ namespace OpenSim.Framework } } - private int m_redirectGridX; - public int redirectGridX { get { return m_redirectGridX; } @@ -110,8 +162,6 @@ namespace OpenSim.Framework } } - private int m_redirectGridY; - public int redirectGridY { get { return m_redirectGridY; } @@ -122,8 +172,6 @@ namespace OpenSim.Framework } } - private Simulator.RegionFlags m_regionFlags; - public Simulator.RegionFlags regionFlags { get { return m_regionFlags; } @@ -131,24 +179,20 @@ namespace OpenSim.Framework { //m_regionFlags = (Simulator.RegionFlags)0x400000; m_regionFlags = value; - configMember.forceSetConfigurationOption("region_flags", ((uint)m_regionFlags).ToString()); + configMember.forceSetConfigurationOption("region_flags", ((uint) m_regionFlags).ToString()); } } - private Simulator.SimAccess m_simAccess; - public Simulator.SimAccess simAccess { get { return m_simAccess; } set { m_simAccess = value; - configMember.forceSetConfigurationOption("sim_access", ((byte)m_simAccess).ToString()); + configMember.forceSetConfigurationOption("sim_access", ((byte) m_simAccess).ToString()); } } - private float m_sunHour; - public float sunHour { get { return m_sunHour; } @@ -159,8 +203,6 @@ namespace OpenSim.Framework } } - private LLVector3 m_sunPosition; - public LLVector3 sunPosition { get { return m_sunPosition; } @@ -171,8 +213,6 @@ namespace OpenSim.Framework } } - private float m_terrainRaiseLimit; - public float terrainRaiseLimit { get { return m_terrainRaiseLimit; } @@ -183,8 +223,6 @@ namespace OpenSim.Framework } } - private float m_terrainLowerLimit; - public float terrainLowerLimit { get { return m_terrainLowerLimit; } @@ -195,8 +233,6 @@ namespace OpenSim.Framework } } - private bool m_useFixedSun; - public bool useFixedSun { get { return m_useFixedSun; } @@ -207,8 +243,6 @@ namespace OpenSim.Framework } } - private int m_pricePerMeter; - public int pricePerMeter { get { return m_pricePerMeter; } @@ -220,8 +254,6 @@ namespace OpenSim.Framework } - private ushort m_regionWaterHeight; - public ushort regionWaterHeight { get { return m_regionWaterHeight; } @@ -233,8 +265,6 @@ namespace OpenSim.Framework } - private bool m_regionAllowTerraform; - public bool regionAllowTerraform { get { return m_regionAllowTerraform; } @@ -248,7 +278,6 @@ namespace OpenSim.Framework // Region Information // Low resolution 'base' textures. No longer used. - private LLUUID m_terrainBase0; public LLUUID terrainBase0 { @@ -260,8 +289,6 @@ namespace OpenSim.Framework } } - private LLUUID m_terrainBase1; - public LLUUID terrainBase1 { get { return m_terrainBase1; } @@ -272,8 +299,6 @@ namespace OpenSim.Framework } } - private LLUUID m_terrainBase2; - public LLUUID terrainBase2 { get { return m_terrainBase2; } @@ -284,8 +309,6 @@ namespace OpenSim.Framework } } - private LLUUID m_terrainBase3; - public LLUUID terrainBase3 { get { return m_terrainBase3; } @@ -298,7 +321,6 @@ namespace OpenSim.Framework // Higher resolution terrain textures - private LLUUID m_terrainDetail0; public LLUUID terrainDetail0 { @@ -310,8 +332,6 @@ namespace OpenSim.Framework } } - private LLUUID m_terrainDetail1; - public LLUUID terrainDetail1 { get { return m_terrainDetail1; } @@ -322,8 +342,6 @@ namespace OpenSim.Framework } } - private LLUUID m_terrainDetail2; - public LLUUID terrainDetail2 { get { return m_terrainDetail2; } @@ -334,8 +352,6 @@ namespace OpenSim.Framework } } - private LLUUID m_terrainDetail3; - public LLUUID terrainDetail3 { get { return m_terrainDetail3; } @@ -347,7 +363,6 @@ namespace OpenSim.Framework } // First quad - each point is bilinearly interpolated at each meter of terrain - private float m_terrainStartHeight0; public float terrainStartHeight0 { @@ -360,8 +375,6 @@ namespace OpenSim.Framework } - private float m_terrainStartHeight1; - public float terrainStartHeight1 { get { return m_terrainStartHeight1; } @@ -372,8 +385,6 @@ namespace OpenSim.Framework } } - private float m_terrainStartHeight2; - public float terrainStartHeight2 { get { return m_terrainStartHeight2; } @@ -384,8 +395,6 @@ namespace OpenSim.Framework } } - private float m_terrainStartHeight3; - public float terrainStartHeight3 { get { return m_terrainStartHeight3; } @@ -399,7 +408,6 @@ namespace OpenSim.Framework // Second quad - also bilinearly interpolated. // Terrain texturing is done that: // 0..3 (0 = base0, 3 = base3) = (terrain[x,y] - start[x,y]) / range[x,y] - private float m_terrainHeightRange0; public float terrainHeightRange0 { @@ -411,8 +419,6 @@ namespace OpenSim.Framework } } - private float m_terrainHeightRange1; - public float terrainHeightRange1 { get { return m_terrainHeightRange1; } @@ -423,8 +429,6 @@ namespace OpenSim.Framework } } - private float m_terrainHeightRange2; - public float terrainHeightRange2 { get { return m_terrainHeightRange2; } @@ -435,8 +439,6 @@ namespace OpenSim.Framework } } - private float m_terrainHeightRange3; - public float terrainHeightRange3 { get { return m_terrainHeightRange3; } @@ -448,7 +450,6 @@ namespace OpenSim.Framework } // Terrain Default (Must be in F32 Format!) - private string m_terrainFile; public string terrainFile { @@ -460,8 +461,6 @@ namespace OpenSim.Framework } } - private double m_terrainMultiplier; - public double terrainMultiplier { get { return m_terrainMultiplier; } @@ -472,8 +471,6 @@ namespace OpenSim.Framework } } - private float m_waterHeight; - public float waterHeight { get { return m_waterHeight; } @@ -484,8 +481,6 @@ namespace OpenSim.Framework } } - private LLUUID m_terrainImageID; - public LLUUID terrainImageID { get { return m_terrainImageID; } @@ -501,7 +496,6 @@ namespace OpenSim.Framework } // Estate name - private string m_estateName; public string estateName { @@ -513,24 +507,14 @@ namespace OpenSim.Framework } } - private LLUUID m_estateManager0; - private LLUUID m_estateManager1; - private LLUUID m_estateManager2; - private LLUUID m_estateManager3; - private LLUUID m_estateManager4; - private LLUUID m_estateManager5; - private LLUUID m_estateManager6; - private LLUUID m_estateManager7; - private LLUUID m_estateManager8; - private LLUUID m_estateManager9; - public LLUUID[] estateManagers { - get { + get + { // returns a condensed array of LLUUIDs return GetEstateManagers(); } - set + set { // Sets a Condensed array of LLUUIDS int i = 0; @@ -611,8 +595,8 @@ namespace OpenSim.Framework for (i = 0; i < 10; i++) { - // Writes out the Estate managers to the XML file. - configMember.forceSetConfigurationOption("estate_manager_" + i, (GetEstateManagerAtPos(i)).ToString()); + // Writes out the Estate managers to the XML file. + configMember.forceSetConfigurationOption("estate_manager_" + i, (GetEstateManagerAtPos(i)).ToString()); } } } @@ -626,37 +610,36 @@ namespace OpenSim.Framework { case 0: return m_estateManager0; - + case 1: return m_estateManager1; - + case 2: return m_estateManager2; - + case 3: return m_estateManager3; - + case 4: return m_estateManager4; - + case 5: return m_estateManager5; - + case 6: return m_estateManager6; - + case 7: return m_estateManager7; - + case 8: return m_estateManager8; - + case 9: return m_estateManager9; - + default: return LLUUID.Zero; - } } @@ -671,8 +654,8 @@ namespace OpenSim.Framework { pos = GetNextEstateManager(pos); - rEstateManagers[i] = GetEstateManagerAtPos(pos); pos++; - + rEstateManagers[i] = GetEstateManagerAtPos(pos); + pos++; } return rEstateManagers; } @@ -681,12 +664,11 @@ namespace OpenSim.Framework { // This is a utility function that skips over estate managers set to LLUUID.Zero int i = startpos; - for (i=startpos;i<10;i++) + for (i = startpos; i < 10; i++) { if (GetEstateManagerAtPos(i) != LLUUID.Zero) return i; } return i; - } private int GetNumberOfEstateManagers() @@ -723,14 +705,13 @@ namespace OpenSim.Framework //Saves it to the estate settings file estateManagers = nestateManagers; - } public void RemoveEstateManager(LLUUID avatarID) { int notfoundparam = 11; // starting high so the condense routine (max ten) doesn't run if we don't find it. LLUUID[] testateManagers = GetEstateManagers(); // temporary estate managers list - + int i = 0; int foundpos = notfoundparam; @@ -766,20 +747,6 @@ namespace OpenSim.Framework #endregion - private ConfigurationMember configMember; - - public EstateSettings() - { - // Temporary hack to prevent multiple loadings. - if (configMember == null) - { - configMember = - new ConfigurationMember(Path.Combine(Util.configDir(), "estate_settings.xml"), "ESTATE SETTINGS", - loadConfigurationOptions, handleIncomingConfiguration, true); - configMember.performConfigurationRetrieve(); - } - } - public void loadConfigurationOptions() { configMember.addConfigurationOption("billable_factor", ConfigurationOption.ConfigurationTypes.TYPE_FLOAT, String.Empty, @@ -1010,38 +977,38 @@ namespace OpenSim.Framework break; case "estate_manager_0": - m_estateManager0 = (LLUUID)configuration_result; + m_estateManager0 = (LLUUID) configuration_result; break; case "estate_manager_1": - m_estateManager1 = (LLUUID)configuration_result; + m_estateManager1 = (LLUUID) configuration_result; break; case "estate_manager_2": - m_estateManager2 = (LLUUID)configuration_result; + m_estateManager2 = (LLUUID) configuration_result; break; case "estate_manager_3": - m_estateManager3 = (LLUUID)configuration_result; + m_estateManager3 = (LLUUID) configuration_result; break; case "estate_manager_4": - m_estateManager4 = (LLUUID)configuration_result; + m_estateManager4 = (LLUUID) configuration_result; break; case "estate_manager_5": - m_estateManager5 = (LLUUID)configuration_result; + m_estateManager5 = (LLUUID) configuration_result; break; case "estate_manager_6": - m_estateManager6 = (LLUUID)configuration_result; + m_estateManager6 = (LLUUID) configuration_result; break; case "estate_manager_7": - m_estateManager7 = (LLUUID)configuration_result; + m_estateManager7 = (LLUUID) configuration_result; break; case "estate_manager_8": - m_estateManager8 = (LLUUID)configuration_result; + m_estateManager8 = (LLUUID) configuration_result; break; case "estate_manager_9": - m_estateManager9 = (LLUUID)configuration_result; + m_estateManager9 = (LLUUID) configuration_result; break; } return true; } } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/FriendListItem.cs b/OpenSim/Framework/FriendListItem.cs index 9220705..d3ca759 100644 --- a/OpenSim/Framework/FriendListItem.cs +++ b/OpenSim/Framework/FriendListItem.cs @@ -31,15 +31,15 @@ namespace OpenSim.Framework { public class FriendListItem { - public LLUUID FriendListOwner; public LLUUID Friend; + public LLUUID FriendListOwner; // These are what the list owner gives the friend permission to do - public uint FriendPerms; // These are what the friend gives the listowner permission to do public uint FriendListOwnerPerms; + public uint FriendPerms; public bool onlinestatus = false; } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/GridConfig.cs b/OpenSim/Framework/GridConfig.cs index 7ccd0c4..f0cf91f 100644 --- a/OpenSim/Framework/GridConfig.cs +++ b/OpenSim/Framework/GridConfig.cs @@ -31,27 +31,22 @@ namespace OpenSim.Framework { public class GridConfig { - public string GridOwner = String.Empty; - public string DefaultAssetServer = String.Empty; - public string AssetSendKey = String.Empty; - public string AssetRecvKey = String.Empty; - - public string DefaultUserServer = String.Empty; - public string UserSendKey = String.Empty; - public string UserRecvKey = String.Empty; - - public string SimSendKey = String.Empty; - public string SimRecvKey = String.Empty; - - public string DatabaseProvider = String.Empty; - - public static uint DefaultHttpPort = 8001; - public uint HttpPort = DefaultHttpPort; public string AllowForcefulBanlines = "TRUE"; + public string AssetRecvKey = String.Empty; + public string AssetSendKey = String.Empty; private ConfigurationMember configMember; + public string DatabaseProvider = String.Empty; + public string DefaultAssetServer = String.Empty; + public string DefaultUserServer = String.Empty; + public string GridOwner = String.Empty; + public uint HttpPort = DefaultHttpPort; + public string SimRecvKey = String.Empty; + public string SimSendKey = String.Empty; + public string UserRecvKey = String.Empty; + public string UserSendKey = String.Empty; public GridConfig(string description, string filename) { @@ -144,4 +139,4 @@ namespace OpenSim.Framework return true; } } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/GridInstantMessage.cs b/OpenSim/Framework/GridInstantMessage.cs index 77e5460..08c5f28 100644 --- a/OpenSim/Framework/GridInstantMessage.cs +++ b/OpenSim/Framework/GridInstantMessage.cs @@ -32,16 +32,15 @@ namespace OpenSim.Framework [Serializable] public class GridInstantMessage { + public byte[] binaryBucket; + public byte dialog; public Guid fromAgentID; + public string fromAgentName; public Guid fromAgentSession; - public Guid toAgentID; + public bool fromGroup; public Guid imSessionID; - public uint timestamp; - public string fromAgentName; public string message; - public byte dialog; - public bool fromGroup; public byte offline; public uint ParentEstateID; @@ -49,11 +48,11 @@ namespace OpenSim.Framework public sLLVector3 Position; public Guid RegionID; - - public byte[] binaryBucket; + public uint timestamp; + public Guid toAgentID; public GridInstantMessage() { - } + } } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/IAssetLoader.cs b/OpenSim/Framework/IAssetLoader.cs index 89db68a..6aa71d3 100644 --- a/OpenSim/Framework/IAssetLoader.cs +++ b/OpenSim/Framework/IAssetLoader.cs @@ -28,10 +28,10 @@ using System; namespace OpenSim.Framework -{ +{ public interface IAssetLoader { void ForEachDefaultXmlAsset(Action action); void ForEachDefaultXmlAsset(string assetSetFilename, Action action); } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/IAssetProvider.cs b/OpenSim/Framework/IAssetProvider.cs index dcb79ea..5c02ff1 100644 --- a/OpenSim/Framework/IAssetProvider.cs +++ b/OpenSim/Framework/IAssetProvider.cs @@ -38,4 +38,4 @@ namespace OpenSim.Framework void CommitAssets(); // force a sync to the database void Initialise(string connect); } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/IAssetServer.cs b/OpenSim/Framework/IAssetServer.cs index 23c0642..06a7e32 100644 --- a/OpenSim/Framework/IAssetServer.cs +++ b/OpenSim/Framework/IAssetServer.cs @@ -50,7 +50,7 @@ namespace OpenSim.Framework /// /// void AssetReceived(AssetBase asset, bool IsTexture); - + /// /// Call back made when an asset server could not retrieve a requested asset /// @@ -62,4 +62,4 @@ namespace OpenSim.Framework { IAssetServer GetAssetServer(); } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index 985e085..20d4e62 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs @@ -74,14 +74,19 @@ namespace OpenSim.Framework /// public class ChatFromViewerArgs : EventArgs, IEventArgs { - protected string m_message; - protected ChatTypeEnum m_type; protected int m_channel; - protected LLVector3 m_position; protected string m_from; + protected string m_message; + protected LLVector3 m_position; - protected IClientAPI m_sender; protected IScene m_scene; + protected IClientAPI m_sender; + protected ChatTypeEnum m_type; + + public ChatFromViewerArgs() + { + m_position = new LLVector3(); + } /// /// The message sent by the user @@ -128,6 +133,8 @@ namespace OpenSim.Framework set { m_from = value; } } + #region IEventArgs Members + /// /// The client responsible for sending the message, or null. /// @@ -146,18 +153,15 @@ namespace OpenSim.Framework set { m_scene = value; } } - public ChatFromViewerArgs() - { - m_position = new LLVector3(); - } + #endregion } public class TextureRequestArgs : EventArgs { - protected LLUUID m_requestedAssetID; private sbyte m_discardLevel; private uint m_packetNumber; private float m_priority; + protected LLUUID m_requestedAssetID; public float Priority { @@ -206,6 +210,8 @@ namespace OpenSim.Framework set { m_nowWearing = value; } } + #region Nested type: Wearable + public class Wearable { public LLUUID ItemID = new LLUUID("00000000-0000-0000-0000-000000000000"); @@ -217,6 +223,8 @@ namespace OpenSim.Framework Type = type; } } + + #endregion } public delegate void TextureRequest(Object sender, TextureRequestArgs e); @@ -224,18 +232,18 @@ namespace OpenSim.Framework public delegate void AvatarNowWearing(Object sender, AvatarWearingArgs e); public delegate void ImprovedInstantMessage(IClientAPI remoteclient, - LLUUID fromAgentID, LLUUID fromAgentSession, LLUUID toAgentID, LLUUID imSessionID, uint timestamp, - string fromAgentName, string message, byte dialog, bool fromGroup, byte offline, uint ParentEstateID, - LLVector3 Position, LLUUID RegionID, byte[] binaryBucket); // This shouldn't be cut down... - // especially if we're ever going to implement groups, presence, estate message dialogs... + LLUUID fromAgentID, LLUUID fromAgentSession, LLUUID toAgentID, LLUUID imSessionID, uint timestamp, + string fromAgentName, string message, byte dialog, bool fromGroup, byte offline, uint ParentEstateID, + LLVector3 Position, LLUUID RegionID, byte[] binaryBucket); // This shouldn't be cut down... + // especially if we're ever going to implement groups, presence, estate message dialogs... public delegate void RezObject(IClientAPI remoteClient, LLUUID itemID, LLVector3 RayEnd, LLVector3 RayStart, - LLUUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection, - uint EveryoneMask, uint GroupMask, uint NextOwnerMask, uint ItemFlags, - bool RezSelected, bool RemoveItem, LLUUID fromTaskID ); + LLUUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection, + uint EveryoneMask, uint GroupMask, uint NextOwnerMask, uint ItemFlags, + bool RezSelected, bool RemoveItem, LLUUID fromTaskID); public delegate void RezSingleAttachmentFromInv(IClientAPI remoteClient, LLUUID itemID, uint AttachmentPt, - uint ItemFlags, uint NextOwnerMask); + uint ItemFlags, uint NextOwnerMask); public delegate void ObjectAttach(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, LLQuaternion rot); @@ -305,12 +313,10 @@ namespace OpenSim.Framework public delegate void ObjectDuplicate(uint localID, LLVector3 offset, uint dupeFlags, LLUUID AgentID, LLUUID GroupID); - public delegate void ObjectDuplicateOnRay(uint localID, uint dupeFlags, LLUUID AgentID, LLUUID GroupID, - LLUUID RayTargetObj, LLVector3 RayEnd, LLVector3 RayStart, - bool BypassRaycast, bool RayEndIsIntersection, bool CopyCenters, bool CopyRotates); + public delegate void ObjectDuplicateOnRay(uint localID, uint dupeFlags, LLUUID AgentID, LLUUID GroupID, + LLUUID RayTargetObj, LLVector3 RayEnd, LLVector3 RayStart, + bool BypassRaycast, bool RayEndIsIntersection, bool CopyCenters, bool CopyRotates); - - public delegate void StatusChange(bool status); @@ -355,7 +361,9 @@ namespace OpenSim.Framework public delegate void UUIDNameRequest(LLUUID id, IClientAPI remote_client); - public delegate void AddNewPrim(LLUUID ownerID, LLVector3 RayEnd, LLQuaternion rot, PrimitiveBaseShape shape, byte bypassRaycast, LLVector3 RayStart, LLUUID RayTargetID, byte RayEndIsIntersection); + public delegate void AddNewPrim( + LLUUID ownerID, LLVector3 RayEnd, LLQuaternion rot, PrimitiveBaseShape shape, byte bypassRaycast, LLVector3 RayStart, LLUUID RayTargetID, + byte RayEndIsIntersection); public delegate void RequestGodlikePowers(LLUUID AgentID, LLUUID SessionID, LLUUID token, bool GodLike, IClientAPI remote_client); @@ -409,7 +417,7 @@ namespace OpenSim.Framework public delegate void UpdateTaskInventory(IClientAPI remoteClient, LLUUID itemID, LLUUID folderID, uint localID); public delegate void MoveTaskInventory(IClientAPI remoteClient, LLUUID folderID, uint localID, LLUUID itemID); - + public delegate void RemoveTaskInventory(IClientAPI remoteClient, LLUUID itemID, uint localID); public delegate void UDPAssetUploadRequest( @@ -422,17 +430,17 @@ namespace OpenSim.Framework public delegate void ConfirmXfer(IClientAPI remoteClient, ulong xferID, uint packetID); - public delegate void FriendActionDelegate(IClientAPI remoteClient,LLUUID agentID,LLUUID transactionID,List callingCardFolders); - - public delegate void FriendshipTermination(IClientAPI remoteClient,LLUUID agentID, LLUUID ExID); + public delegate void FriendActionDelegate(IClientAPI remoteClient, LLUUID agentID, LLUUID transactionID, List callingCardFolders); + + public delegate void FriendshipTermination(IClientAPI remoteClient, LLUUID agentID, LLUUID ExID); public delegate void PacketStats(int inPackets, int outPackets, int unAckedBytes); - + public delegate void MoneyTransferRequest(LLUUID sourceID, LLUUID destID, int amount, int transactionType, string description); public delegate void ParcelBuy(LLUUID agentId, LLUUID groupId, bool final, bool groupOwned, - bool removeContribution, int parcelLocalID, int parcelArea, int parcelPrice, bool authenticated); - + bool removeContribution, int parcelLocalID, int parcelArea, int parcelPrice, bool authenticated); + // We keep all this information for fraud purposes in the future. public delegate void MoneyBalanceRequest(IClientAPI remoteClient, LLUUID agentID, LLUUID sessionID, LLUUID TransactionID); @@ -443,10 +451,33 @@ namespace OpenSim.Framework public delegate void ObjectIncludeInSearch(IClientAPI remoteClient, bool IncludeInSearch, uint localID); public delegate void ScriptAnswer(IClientAPI remoteClient, LLUUID objectID, LLUUID itemID, int answer); + public delegate void RequestPayPrice(IClientAPI remoteClient, LLUUID objectID); - + public interface IClientAPI { + LLVector3 StartPos { get; set; } + + LLUUID AgentId { get; } + + LLUUID SessionId { get; } + + LLUUID SecureSessionId { get; } + + string FirstName { get; } + + string LastName { get; } + + int NextAnimationSequenceNumber { get; } + + /// + /// Returns the full name of the agent/avatar represented by this client + /// + /// + /// + string Name { get; } + + uint CircuitCode { get; } event ImprovedInstantMessage OnInstantMessage; event ChatFromViewer OnChatFromViewer; event TextureRequest OnRequestTexture; @@ -563,38 +594,15 @@ namespace OpenSim.Framework event MoneyBalanceRequest OnMoneyBalanceRequest; event UpdateAvatarProperties OnUpdateAvatarProperties; event ParcelBuy OnParcelBuy; - event RequestPayPrice OnRequestPayPrice ; + event RequestPayPrice OnRequestPayPrice; event ObjectIncludeInSearch OnObjectIncludeInSearch; event UUIDNameRequest OnTeleportHomeRequest; - + event ScriptAnswer OnScriptAnswer; event AgentSit OnUndo; - - LLVector3 StartPos { get; set; } - - LLUUID AgentId { get; } - - LLUUID SessionId { get; } - - LLUUID SecureSessionId { get; } - - string FirstName { get; } - - string LastName { get; } - - int NextAnimationSequenceNumber { get; } - - /// - /// Returns the full name of the agent/avatar represented by this client - /// - /// - /// - string Name { get; } - - uint CircuitCode { get; } void OutPacket(Packet newPack, ThrottleOutPacketType packType); void SendWearables(AvatarWearable[] wearables, int serial); @@ -608,9 +616,10 @@ namespace OpenSim.Framework void SendInstantMessage(LLUUID fromAgent, LLUUID fromAgentSession, string message, LLUUID toAgent, LLUUID imSessionID, string fromName, byte dialog, uint timeStamp); + void SendInstantMessage(LLUUID fromAgent, LLUUID fromAgentSession, string message, LLUUID toAgent, - LLUUID imSessionID, string fromName, byte dialog, uint timeStamp, - byte[] binaryBucket); + LLUUID imSessionID, string fromName, byte dialog, uint timeStamp, + byte[] binaryBucket); void SendLayerData(float[] map); void SendLayerData(int px, int py, float[] map); @@ -645,9 +654,9 @@ namespace OpenSim.Framework void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, LLVector3 pos, uint flags, LLUUID objectID, LLUUID ownerID, string text, byte[] color, - uint parentID, byte[] particleSystem, LLQuaternion rotation, byte clickAction, byte[] textureanimation, - bool attachment, uint AttachmentPoint, LLUUID AssetId); - + uint parentID, byte[] particleSystem, LLQuaternion rotation, byte clickAction, byte[] textureanimation, + bool attachment, uint AttachmentPoint, LLUUID AssetId); + void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, LLVector3 pos, uint flags, LLUUID objectID, LLUUID ownerID, string text, byte[] color, uint parentID, byte[] particleSystem, LLQuaternion rotation, byte clickAction); @@ -657,7 +666,7 @@ namespace OpenSim.Framework void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, LLQuaternion rotation, LLVector3 velocity, LLVector3 rotationalvelocity); - + void SendInventoryFolderDetails(LLUUID ownerID, LLUUID folderID, List items, List folders, bool fetchFolders, bool fetchItems); @@ -672,20 +681,20 @@ namespace OpenSim.Framework void SendRemoveInventoryItem(LLUUID itemID); void SendTaskInventory(LLUUID taskID, short serial, byte[] fileName); - + /// /// Used by the server to inform the client of a new inventory item. Used when transferring items /// between avatars, possibly among other things. /// /// void SendBulkUpdateInventory(InventoryItemBase item); - + void SendXferPacket(ulong xferID, uint packet, byte[] data); void SendEconomyData(float EnergyEfficiency, int ObjectCapacity, int ObjectCount, int PriceEnergyUnit, - int PriceGroupCreate, int PriceObjectClaim, float PriceObjectRent, float PriceObjectScaleFactor, - int PriceParcelClaim, float PriceParcelClaimFactor, int PriceParcelRent, int PricePublicObjectDecay, - int PricePublicObjectDelete, int PriceRentLight, int PriceUpload, int TeleportMinPrice, float TeleportPriceExponent); + int PriceGroupCreate, int PriceObjectClaim, float PriceObjectRent, float PriceObjectScaleFactor, + int PriceParcelClaim, float PriceParcelClaimFactor, int PriceParcelRent, int PricePublicObjectDecay, + int PricePublicObjectDelete, int PriceRentLight, int PriceUpload, int TeleportMinPrice, float TeleportPriceExponent); void SendAvatarPickerReply(AvatarPickerReplyPacket Pack); @@ -709,10 +718,11 @@ namespace OpenSim.Framework void SendAvatarProperties(LLUUID avatarID, string aboutText, string bornOn, string charterMember, string flAbout, uint flags, LLUUID flImageID, LLUUID imageID, string profileURL, LLUUID partnerID); + void SendScriptQuestion(LLUUID taskID, string taskName, string ownerName, LLUUID itemID, int question); byte[] GetThrottlesPacked(float multiplier); - + void SetDebug(int newDebug); void InPacket(Packet NewPack); @@ -734,16 +744,16 @@ namespace OpenSim.Framework [Serializable] public class ClientInfo { - public byte[] usecircuit; - public EndPoint userEP; - public EndPoint proxyEP; public sAgentCircuitData agentcircuit; - public Dictionary pendingAcks; public Dictionary needAck; public List out_packets; + public Dictionary pendingAcks; + public EndPoint proxyEP; public uint sequence; + public byte[] usecircuit; + public EndPoint userEP; } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/IGenericConfig.cs b/OpenSim/Framework/IGenericConfig.cs index 767a920..9c1d522 100644 --- a/OpenSim/Framework/IGenericConfig.cs +++ b/OpenSim/Framework/IGenericConfig.cs @@ -37,4 +37,4 @@ namespace OpenSim.Framework void Commit(); void Close(); } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/IInventoryData.cs b/OpenSim/Framework/IInventoryData.cs index 508099e..f283085 100644 --- a/OpenSim/Framework/IInventoryData.cs +++ b/OpenSim/Framework/IInventoryData.cs @@ -56,14 +56,14 @@ namespace OpenSim.Framework /// /// A string containing the plugin version string getVersion(); - + /// /// Returns all child folders in the hierarchy from the parent folder and down. /// Does not return the parent folder itself. /// /// The folder to get subfolders for /// A list of inventory folders - List getFolderHierarchy(LLUUID parentID); + List getFolderHierarchy(LLUUID parentID); /// /// Returns a list of inventory items contained within the specified folder @@ -149,4 +149,4 @@ namespace OpenSim.Framework /// The id of the folder void deleteInventoryFolder(LLUUID folder); } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/IPlugin.cs b/OpenSim/Framework/IPlugin.cs index 96f8257..8a0b2b1 100644 --- a/OpenSim/Framework/IPlugin.cs +++ b/OpenSim/Framework/IPlugin.cs @@ -49,4 +49,4 @@ namespace OpenSim.Framework /// void Initialise(); } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/IRegionCommsListener.cs b/OpenSim/Framework/IRegionCommsListener.cs index 7726634..1476855 100644 --- a/OpenSim/Framework/IRegionCommsListener.cs +++ b/OpenSim/Framework/IRegionCommsListener.cs @@ -64,4 +64,4 @@ namespace OpenSim.Framework event RegionUp OnRegionUp; event ChildAgentUpdate OnChildAgentUpdate; } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/IRegionLoader.cs b/OpenSim/Framework/IRegionLoader.cs index d383825..87638a9 100644 --- a/OpenSim/Framework/IRegionLoader.cs +++ b/OpenSim/Framework/IRegionLoader.cs @@ -34,4 +34,4 @@ namespace OpenSim.Framework void SetIniConfigSource(IniConfigSource configSource); RegionInfo[] LoadRegions(); } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/IScene.cs b/OpenSim/Framework/IScene.cs index cdf6257..018b51f 100644 --- a/OpenSim/Framework/IScene.cs +++ b/OpenSim/Framework/IScene.cs @@ -39,11 +39,16 @@ namespace OpenSim.Framework Up = 1, Crashed = 2, Starting = 3, - SlaveScene = 4 - }; + SlaveScene = 4 + } ; public interface IScene { + RegionInfo RegionInfo { get; } + uint NextLocalId { get; } + RegionStatus Region_Status { get; set; } + + ClientManager ClientManager { get; } event restart OnRestart; void AddNewClient(IClientAPI client, bool child); @@ -55,15 +60,8 @@ namespace OpenSim.Framework string GetSimulatorVersion(); - RegionInfo RegionInfo { get; } - uint NextLocalId { get; } - bool PresenceChildStatus(LLUUID avatarID); - RegionStatus Region_Status { get; set; } - - ClientManager ClientManager { get; } - - string GetCapsPath(LLUUID agentId); + string GetCapsPath(LLUUID agentId); } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/IUserData.cs b/OpenSim/Framework/IUserData.cs index 9749135..a926883 100644 --- a/OpenSim/Framework/IUserData.cs +++ b/OpenSim/Framework/IUserData.cs @@ -139,6 +139,7 @@ namespace OpenSim.Framework /// /// The agent that we're retreiving the friends Data. List GetUserFriendList(LLUUID friendlistowner); + /// /// Attempts to move currency units between accounts (NOT RELIABLE / TRUSTWORTHY. DONT TRY RUN YOUR OWN CURRENCY EXCHANGE WITH REAL VALUES) /// @@ -174,4 +175,4 @@ namespace OpenSim.Framework /// void Initialise(); } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/IUserService.cs b/OpenSim/Framework/IUserService.cs index 88e992e..2b6e0d5 100644 --- a/OpenSim/Framework/IUserService.cs +++ b/OpenSim/Framework/IUserService.cs @@ -39,16 +39,16 @@ namespace OpenSim.Framework /// Last name /// A user profile. Returns null if no profile is found UserProfileData GetUserProfile(string firstName, string lastName); - + //UserProfileData GetUserProfile(string name); - + /// /// Loads a user profile from a database by UUID /// /// The target UUID /// A user profile. Returns null if no user profile is found. UserProfileData GetUserProfile(LLUUID userId); - + void clearUserAgent(LLUUID avatarID); List GenerateAgentPickerRequestResponse(LLUUID QueryID, string Query); @@ -109,4 +109,4 @@ namespace OpenSim.Framework /// The agent that we're retreiving the friends Data. List GetUserFriendList(LLUUID friendlistowner); } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/InventoryCollection.cs b/OpenSim/Framework/InventoryCollection.cs index e5e8f62..df18efb 100644 --- a/OpenSim/Framework/InventoryCollection.cs +++ b/OpenSim/Framework/InventoryCollection.cs @@ -39,4 +39,4 @@ namespace OpenSim.Framework public List Items; public LLUUID UserID; } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/InventoryConfig.cs b/OpenSim/Framework/InventoryConfig.cs index 1e22fe8..67abbaf 100644 --- a/OpenSim/Framework/InventoryConfig.cs +++ b/OpenSim/Framework/InventoryConfig.cs @@ -34,18 +34,16 @@ namespace OpenSim.Framework /// public class InventoryConfig { - public string DefaultStartupMsg = String.Empty; - public string UserServerURL = String.Empty; - public string UserSendKey = String.Empty; - public string UserRecvKey = String.Empty; - - public string DatabaseProvider = String.Empty; - public string DatabaseConnect = String.Empty; public static uint DefaultHttpPort = 8004; - public uint HttpPort = DefaultHttpPort; - private ConfigurationMember configMember; + public string DatabaseConnect = String.Empty; + public string DatabaseProvider = String.Empty; + public string DefaultStartupMsg = String.Empty; + public uint HttpPort = DefaultHttpPort; + public string UserRecvKey = String.Empty; + public string UserSendKey = String.Empty; + public string UserServerURL = String.Empty; public InventoryConfig(string description, string filename) { @@ -79,30 +77,30 @@ namespace OpenSim.Framework { switch (configuration_key) { - case "default_startup_message": - DefaultStartupMsg = (string) configuration_result; - break; - case "default_user_server": - UserServerURL = (string) configuration_result; - break; - case "user_send_key": - UserSendKey = (string) configuration_result; - break; - case "user_recv_key": - UserRecvKey = (string) configuration_result; - break; - case "database_provider": - DatabaseProvider = (string) configuration_result; - break; - case "database_connect": - DatabaseConnect = (string) configuration_result; - break; - case "http_port": - HttpPort = (uint) configuration_result; - break; + case "default_startup_message": + DefaultStartupMsg = (string) configuration_result; + break; + case "default_user_server": + UserServerURL = (string) configuration_result; + break; + case "user_send_key": + UserSendKey = (string) configuration_result; + break; + case "user_recv_key": + UserRecvKey = (string) configuration_result; + break; + case "database_provider": + DatabaseProvider = (string) configuration_result; + break; + case "database_connect": + DatabaseConnect = (string) configuration_result; + break; + case "http_port": + HttpPort = (uint) configuration_result; + break; } return true; } } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/InventoryFolderBase.cs b/OpenSim/Framework/InventoryFolderBase.cs index d3af3c7..910f7da 100644 --- a/OpenSim/Framework/InventoryFolderBase.cs +++ b/OpenSim/Framework/InventoryFolderBase.cs @@ -35,6 +35,11 @@ namespace OpenSim.Framework public class InventoryFolderBase { /// + /// The UUID for this folder + /// + private LLUUID _id; + + /// /// The name of the folder (64 characters or less) /// private string _name; @@ -50,11 +55,6 @@ namespace OpenSim.Framework private LLUUID _parentID; /// - /// The UUID for this folder - /// - private LLUUID _id; - - /// /// Type of items normally stored in this folder /// private short _type; @@ -65,59 +65,41 @@ namespace OpenSim.Framework /// time to time (1.19.1 caused us some fits there). /// private ushort _version; - - public string Name { - get { - return _name; - } - set { - _name = value; - } + + public string Name + { + get { return _name; } + set { _name = value; } } - public LLUUID Owner { - get { - return _owner; - } - set { - _owner = value; - } + public LLUUID Owner + { + get { return _owner; } + set { _owner = value; } } - public LLUUID ParentID { - get { - return _parentID; - } - set { - _parentID = value; - } + public LLUUID ParentID + { + get { return _parentID; } + set { _parentID = value; } } - public LLUUID ID { - get { - return _id; - } - set { - _id = value; - } + public LLUUID ID + { + get { return _id; } + set { _id = value; } } - public short Type { - get { - return _type; - } - set { - _type = value; - } + public short Type + { + get { return _type; } + set { _type = value; } } - public ushort Version { - get { - return _version; - } - set { - _version = value; - } + public ushort Version + { + get { return _version; } + set { _version = value; } } } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/InventoryItemBase.cs b/OpenSim/Framework/InventoryItemBase.cs index ccb8163..3d75a8a 100644 --- a/OpenSim/Framework/InventoryItemBase.cs +++ b/OpenSim/Framework/InventoryItemBase.cs @@ -35,11 +35,6 @@ namespace OpenSim.Framework public class InventoryItemBase { /// - /// A UUID containing the ID for the inventory item itself - /// - private LLUUID _id; - - /// /// The UUID of the associated asset on the asset server /// private LLUUID _assetID; @@ -50,170 +45,136 @@ namespace OpenSim.Framework private int _assetType; /// - /// The type of inventory item. (Can be slightly different to the asset type + /// /// - private int _invType; + private uint _basePermissions; /// - /// The folder this item is contained in + /// The creator of this item /// - private LLUUID _folder; + private LLUUID _creator; /// - /// The owner of this inventory item + /// A mask containing permissions for the current owner (cannot be enforced) /// - private LLUUID _owner; + private uint _currentPermissions; /// - /// The creator of this item + /// The description of the inventory item (must be less than 64 characters) /// - private LLUUID _creator; + private string _description; /// - /// The name of the inventory item (must be less than 64 characters) + /// /// - private string _name; + private uint _everyOnePermissions; /// - /// The description of the inventory item (must be less than 64 characters) + /// The folder this item is contained in /// - private string _description; + private LLUUID _folder; /// - /// A mask containing the permissions for the next owner (cannot be enforced) + /// A UUID containing the ID for the inventory item itself /// - private uint _nextPermissions; + private LLUUID _id; /// - /// A mask containing permissions for the current owner (cannot be enforced) + /// The type of inventory item. (Can be slightly different to the asset type /// - private uint _currentPermissions; + private int _invType; /// - /// + /// The name of the inventory item (must be less than 64 characters) /// - private uint _basePermissions; + private string _name; /// - /// + /// A mask containing the permissions for the next owner (cannot be enforced) /// - private uint _everyOnePermissions; - - public LLUUID ID { - get { - return _id; - } - set { - _id = value; - } + private uint _nextPermissions; + + /// + /// The owner of this inventory item + /// + private LLUUID _owner; + + public LLUUID ID + { + get { return _id; } + set { _id = value; } } - public int InvType { - get { - return _invType; - } - set { - _invType = value; - } + public int InvType + { + get { return _invType; } + set { _invType = value; } } - public LLUUID Folder { - get { - return _folder; - } - set { - _folder = value; - } + public LLUUID Folder + { + get { return _folder; } + set { _folder = value; } } - public LLUUID Owner { - get { - return _owner; - } - set { - _owner = value; - } + public LLUUID Owner + { + get { return _owner; } + set { _owner = value; } } - public LLUUID Creator { - get { - return _creator; - } - set { - _creator = value; - } + public LLUUID Creator + { + get { return _creator; } + set { _creator = value; } } - public string Name { - get { - return _name; - } - set { - _name = value; - } + public string Name + { + get { return _name; } + set { _name = value; } } - public string Description { - get { - return _description; - } - set { - _description = value; - } + public string Description + { + get { return _description; } + set { _description = value; } } - public uint NextPermissions { - get { - return _nextPermissions; - } - set { - _nextPermissions = value; - } + public uint NextPermissions + { + get { return _nextPermissions; } + set { _nextPermissions = value; } } - public uint CurrentPermissions { - get { - return _currentPermissions; - } - set { - _currentPermissions = value; - } + public uint CurrentPermissions + { + get { return _currentPermissions; } + set { _currentPermissions = value; } } - public uint BasePermissions { - get { - return _basePermissions; - } - set { - _basePermissions = value; - } + public uint BasePermissions + { + get { return _basePermissions; } + set { _basePermissions = value; } } - public uint EveryOnePermissions { - get { - return _everyOnePermissions; - } - set { - _everyOnePermissions = value; - } + public uint EveryOnePermissions + { + get { return _everyOnePermissions; } + set { _everyOnePermissions = value; } } - public int AssetType { - get { - return _assetType; - } - set { - _assetType = value; - } + public int AssetType + { + get { return _assetType; } + set { _assetType = value; } } - public LLUUID AssetID { - get { - return _assetID; - } - set { - _assetID = value; - } + public LLUUID AssetID + { + get { return _assetID; } + set { _assetID = value; } } } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/JId.cs b/OpenSim/Framework/JId.cs index dac4838..00e8ef1 100644 --- a/OpenSim/Framework/JId.cs +++ b/OpenSim/Framework/JId.cs @@ -31,15 +31,15 @@ namespace OpenSim.Framework { public class JId { + public string resource = String.Empty; public string ServerIP = String.Empty; public int ServerPort = 0; public string username = String.Empty; - public string resource = String.Empty; public JId() { - } + public JId(string sJId) { // user@address:port/resource @@ -53,14 +53,13 @@ namespace OpenSim.Framework string[] resourcesplit = serversplit[1].Split('/'); ServerPort = Convert.ToInt32(resourcesplit[0]); - + if (resourcesplit.GetUpperBound(0) == 2) resource = resourcesplit[1]; username = jidsplit[0]; - } } } } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/LandData.cs b/OpenSim/Framework/LandData.cs index 6d2c5d7..68c4c2e 100644 --- a/OpenSim/Framework/LandData.cs +++ b/OpenSim/Framework/LandData.cs @@ -33,28 +33,20 @@ namespace OpenSim.Framework { public class LandData { - public byte[] landBitmapByteArray = new byte[512]; - public string landName = "Your Parcel"; - public string landDesc = String.Empty; - public LLUUID ownerID = LLUUID.Zero; - public bool isGroupOwned = false; - public LLVector3 AABBMin = new LLVector3(); public LLVector3 AABBMax = new LLVector3(); + public LLVector3 AABBMin = new LLVector3(); public int area = 0; public uint auctionID = 0; //Unemplemented. If set to 0, not being auctioned public LLUUID authBuyerID = LLUUID.Zero; //Unemplemented. Authorized Buyer's UUID public Parcel.ParcelCategory category = new Parcel.ParcelCategory(); //Unemplemented. Parcel's chosen category public int claimDate = 0; //Unemplemented public int claimPrice = 0; //Unemplemented + public LLUUID globalID = LLUUID.Zero; public LLUUID groupID = LLUUID.Zero; //Unemplemented public int groupPrims = 0; - public int otherPrims = 0; - public int ownerPrims = 0; - public int selectedPrims = 0; - public int simwidePrims = 0; - public int simwideArea = 0; - public int salePrice = 0; //Unemeplemented. Parcels price. - public Parcel.ParcelStatus landStatus = Parcel.ParcelStatus.Leased; + public bool isGroupOwned = false; + public byte[] landBitmapByteArray = new byte[512]; + public string landDesc = String.Empty; public uint landFlags = (uint) Parcel.ParcelFlags.AllowFly | (uint) Parcel.ParcelFlags.AllowLandmark | @@ -64,21 +56,28 @@ namespace OpenSim.Framework (uint) Parcel.ParcelFlags.SoundLocal; public byte landingType = 0; + public string landName = "Your Parcel"; + public Parcel.ParcelStatus landStatus = Parcel.ParcelStatus.Leased; + public int localID = 0; public byte mediaAutoScale = 0; public LLUUID mediaID = LLUUID.Zero; - public int localID = 0; - public LLUUID globalID = LLUUID.Zero; public string mediaURL = String.Empty; public string musicURL = String.Empty; + public int otherPrims = 0; + public LLUUID ownerID = LLUUID.Zero; + public int ownerPrims = 0; + public List parcelAccessList = new List(); public float passHours = 0; public int passPrice = 0; + public int salePrice = 0; //Unemeplemented. Parcels price. + public int selectedPrims = 0; + public int simwideArea = 0; + public int simwidePrims = 0; public LLUUID snapshotID = LLUUID.Zero; public LLVector3 userLocation = new LLVector3(); public LLVector3 userLookAt = new LLVector3(); - public List parcelAccessList = new List(); - public LandData() { globalID = LLUUID.Random(); @@ -136,4 +135,4 @@ namespace OpenSim.Framework return landData; } } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/Login.cs b/OpenSim/Framework/Login.cs index bc3375d..e754e9f 100644 --- a/OpenSim/Framework/Login.cs +++ b/OpenSim/Framework/Login.cs @@ -32,15 +32,15 @@ namespace OpenSim.Framework { public class Login { - public string First = "Test"; - public string Last = "User"; public LLUUID Agent; - public LLUUID Session; - public LLUUID SecureSession = LLUUID.Zero; - public LLUUID InventoryFolder; public LLUUID BaseFolder; - public uint CircuitCode; public string CapsPath = String.Empty; + public uint CircuitCode; + public string First = "Test"; + public LLUUID InventoryFolder; + public string Last = "User"; + public LLUUID SecureSession = LLUUID.Zero; + public LLUUID Session; public LLVector3 StartPos; public Login() @@ -48,4 +48,4 @@ namespace OpenSim.Framework StartPos = new LLVector3(128, 128, 70); } } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/MapBlockData.cs b/OpenSim/Framework/MapBlockData.cs index b9c88fa..60f5be3 100644 --- a/OpenSim/Framework/MapBlockData.cs +++ b/OpenSim/Framework/MapBlockData.cs @@ -32,18 +32,18 @@ namespace OpenSim.Framework { public class MapBlockData { - public uint Flags; - public ushort X; - public ushort Y; - public byte Agents; public byte Access; - public byte WaterHeight; + public byte Agents; + public uint Flags; public LLUUID MapImageId; public String Name; public uint RegionFlags; + public byte WaterHeight; + public ushort X; + public ushort Y; public MapBlockData() { } } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/MessageServerConfig.cs b/OpenSim/Framework/MessageServerConfig.cs index dbc06db..c378d27 100644 --- a/OpenSim/Framework/MessageServerConfig.cs +++ b/OpenSim/Framework/MessageServerConfig.cs @@ -34,25 +34,21 @@ namespace OpenSim.Framework /// public class MessageServerConfig { - public string DefaultStartupMsg = String.Empty; - public string UserServerURL = String.Empty; - public string UserSendKey = String.Empty; - public string UserRecvKey = String.Empty; - - public string GridServerURL = String.Empty; - public string GridSendKey = String.Empty; - public string GridRecvKey = String.Empty; - public string MessageServerIP = String.Empty; - - public string DatabaseProvider = String.Empty; - public string GridCommsProvider = String.Empty; - public static uint DefaultHttpPort = 8006; public static bool DefaultHttpSSL = false; + private ConfigurationMember configMember; + public string DatabaseProvider = String.Empty; + public string DefaultStartupMsg = String.Empty; + public string GridCommsProvider = String.Empty; + public string GridRecvKey = String.Empty; + public string GridSendKey = String.Empty; + public string GridServerURL = String.Empty; public uint HttpPort = DefaultHttpPort; public bool HttpSSL = DefaultHttpSSL; - - private ConfigurationMember configMember; + public string MessageServerIP = String.Empty; + public string UserRecvKey = String.Empty; + public string UserSendKey = String.Empty; + public string UserServerURL = String.Empty; public MessageServerConfig(string description, string filename) { @@ -60,9 +56,9 @@ namespace OpenSim.Framework new ConfigurationMember(filename, description, loadConfigurationOptions, handleIncomingConfiguration, true); configMember.performConfigurationRetrieve(); } + public void loadConfigurationOptions() { - configMember.addConfigurationOption("default_user_server", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Default User Server URI", @@ -82,7 +78,7 @@ namespace OpenSim.Framework configMember.addConfigurationOption("database_provider", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "DLL for database provider", "OpenSim.Data.MySQL.dll", false); - + configMember.addConfigurationOption("region_comms_provider", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "DLL for comms provider", "OpenSim.Region.Communications.OGS1.dll", false); @@ -91,51 +87,49 @@ namespace OpenSim.Framework configMember.addConfigurationOption("http_ssl", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN, "Use SSL? true/false", DefaultHttpSSL.ToString(), false); configMember.addConfigurationOption("published_ip", ConfigurationOption.ConfigurationTypes.TYPE_STRING, - "My Published IP Address", "127.0.0.1", false); - + "My Published IP Address", "127.0.0.1", false); } public bool handleIncomingConfiguration(string configuration_key, object configuration_result) { switch (configuration_key) { - case "default_user_server": - UserServerURL = (string)configuration_result; + UserServerURL = (string) configuration_result; break; case "user_send_key": - UserSendKey = (string)configuration_result; + UserSendKey = (string) configuration_result; break; case "user_recv_key": - UserRecvKey = (string)configuration_result; + UserRecvKey = (string) configuration_result; break; case "default_grid_server": - GridServerURL = (string)configuration_result; + GridServerURL = (string) configuration_result; break; case "grid_send_key": - GridSendKey = (string)configuration_result; + GridSendKey = (string) configuration_result; break; case "grid_recv_key": - GridRecvKey = (string)configuration_result; + GridRecvKey = (string) configuration_result; break; case "database_provider": - DatabaseProvider = (string)configuration_result; + DatabaseProvider = (string) configuration_result; break; case "http_port": - HttpPort = (uint)configuration_result; + HttpPort = (uint) configuration_result; break; case "http_ssl": - HttpSSL = (bool)configuration_result; + HttpSSL = (bool) configuration_result; break; case "region_comms_provider": - GridCommsProvider = (string)configuration_result; + GridCommsProvider = (string) configuration_result; break; case "published_ip": - MessageServerIP = (string)configuration_result; + MessageServerIP = (string) configuration_result; break; - } + } return true; } } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/NeighbourInfo.cs b/OpenSim/Framework/NeighbourInfo.cs index bf2db9f..3932c6d 100644 --- a/OpenSim/Framework/NeighbourInfo.cs +++ b/OpenSim/Framework/NeighbourInfo.cs @@ -29,14 +29,14 @@ namespace OpenSim.Framework { public class NeighbourInfo { - public NeighbourInfo() - { - } - public ulong regionhandle; public uint RegionLocX; public uint RegionLocY; public string sim_ip; public uint sim_port; + + public NeighbourInfo() + { + } } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/NetworkServersInfo.cs b/OpenSim/Framework/NetworkServersInfo.cs index ee11924..399a365 100644 --- a/OpenSim/Framework/NetworkServersInfo.cs +++ b/OpenSim/Framework/NetworkServersInfo.cs @@ -32,23 +32,22 @@ namespace OpenSim.Framework { public class NetworkServersInfo { - public string AssetURL = "http://127.0.0.1:" + AssetConfig.DefaultHttpPort.ToString() + "/"; + public static readonly uint DefaultHttpListenerPort = 9000; + public static uint RemotingListenerPort = 8895; public string AssetSendKey = String.Empty; + public string AssetURL = "http://127.0.0.1:" + AssetConfig.DefaultHttpPort.ToString() + "/"; - public string GridURL = String.Empty; - public string GridSendKey = String.Empty; public string GridRecvKey = String.Empty; - public string UserURL = String.Empty; - public string UserSendKey = String.Empty; - public string UserRecvKey = String.Empty; - public bool isSandbox; - - public string InventoryURL = String.Empty; - - public static readonly uint DefaultHttpListenerPort = 9000; + public string GridSendKey = String.Empty; + public string GridURL = String.Empty; public uint HttpListenerPort = DefaultHttpListenerPort; - - public static uint RemotingListenerPort = 8895; + public string InventoryURL = String.Empty; + public bool isSandbox; + private uint? m_defaultHomeLocX; + private uint? m_defaultHomeLocY; + public string UserRecvKey = String.Empty; + public string UserSendKey = String.Empty; + public string UserURL = String.Empty; public NetworkServersInfo() @@ -61,15 +60,11 @@ namespace OpenSim.Framework m_defaultHomeLocY = defaultHomeLocY; } - private uint? m_defaultHomeLocX; - public uint DefaultHomeLocX { get { return m_defaultHomeLocX.Value; } } - private uint? m_defaultHomeLocY; - public uint DefaultHomeLocY { get { return m_defaultHomeLocY.Value; } @@ -100,4 +95,4 @@ namespace OpenSim.Framework InventoryConfig.DefaultHttpPort.ToString()); } } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/OSUUID.cs b/OpenSim/Framework/OSUUID.cs index 90de347..cb83ff2 100644 --- a/OpenSim/Framework/OSUUID.cs +++ b/OpenSim/Framework/OSUUID.cs @@ -31,13 +31,17 @@ using libsecondlife; namespace OpenSim.Framework { [Serializable] - public class OSUUID: IComparable + public class OSUUID : IComparable { + public static readonly OSUUID Zero = new OSUUID(); public Guid UUID; - - public OSUUID() {} + + public OSUUID() + { + } /* Constructors */ + public OSUUID(string s) { if (s == null) @@ -61,6 +65,21 @@ namespace OpenSim.Framework UUID = new Guid(0, 0, 0, BitConverter.GetBytes(u)); } + #region IComparable Members + + public int CompareTo(object obj) + { + if (obj is OSUUID) + { + OSUUID ID = (OSUUID) obj; + return UUID.CompareTo(ID.UUID); + } + + throw new ArgumentException("object is not a OSUUID"); + } + + #endregion + // out conversion public override string ToString() { @@ -81,20 +100,9 @@ namespace OpenSim.Framework public override bool Equals(object o) { if (!(o is LLUUID)) return false; - - OSUUID uuid = (OSUUID)o; - return UUID == uuid.UUID; - } - - public int CompareTo(object obj) - { - if (obj is OSUUID) - { - OSUUID ID = (OSUUID)obj; - return this.UUID.CompareTo(ID.UUID); - } - throw new ArgumentException("object is not a OSUUID"); + OSUUID uuid = (OSUUID) o; + return UUID == uuid.UUID; } // Static methods @@ -102,7 +110,5 @@ namespace OpenSim.Framework { return new OSUUID(Guid.NewGuid()); } - - public static readonly OSUUID Zero = new OSUUID(); } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/PacketPool.cs b/OpenSim/Framework/PacketPool.cs index 22f952a..be56cdc 100644 --- a/OpenSim/Framework/PacketPool.cs +++ b/OpenSim/Framework/PacketPool.cs @@ -35,18 +35,31 @@ namespace OpenSim.Framework { public sealed class PacketPool { - static public void EncodeProxyMessage(byte[] bytes, ref int numBytes, EndPoint trueEP) + private static readonly PacketPool instance = new PacketPool(); + + private Hashtable pool = new Hashtable(); + + static PacketPool() + { + } + + public static PacketPool Instance + { + get { return instance; } + } + + public static void EncodeProxyMessage(byte[] bytes, ref int numBytes, EndPoint trueEP) { - if( numBytes > 4090 ) // max UPD size = 4096 + if (numBytes > 4090) // max UPD size = 4096 { throw new Exception("ERROR: No space to encode the proxy EP"); } ushort port = (ushort) ((IPEndPoint) trueEP).Port; - bytes[numBytes++] = (byte)(port % 256); - bytes[numBytes++] = (byte)(port / 256); - - foreach (byte b in ((IPEndPoint)trueEP).Address.GetAddressBytes()) + bytes[numBytes++] = (byte) (port % 256); + bytes[numBytes++] = (byte) (port / 256); + + foreach (byte b in ((IPEndPoint) trueEP).Address.GetAddressBytes()) { bytes[numBytes++] = b; } @@ -57,8 +70,8 @@ namespace OpenSim.Framework numBytes = x; } - - static public EndPoint DecodeProxyMessage(byte[] bytes, ref int numBytes) + + public static EndPoint DecodeProxyMessage(byte[] bytes, ref int numBytes) { // IPv4 Only byte[] addr = new byte[4]; @@ -68,35 +81,19 @@ namespace OpenSim.Framework addr[1] = bytes[--numBytes]; addr[0] = bytes[--numBytes]; - ushort port = (ushort)(bytes[--numBytes] * 256); - port += (ushort)bytes[--numBytes]; - - return (EndPoint) new IPEndPoint(new IPAddress(addr), (int)port); - } + ushort port = (ushort) (bytes[--numBytes] * 256); + port += (ushort) bytes[--numBytes]; - // Set up a thread-safe singleton pattern - static PacketPool() - { + return (EndPoint) new IPEndPoint(new IPAddress(addr), (int) port); } - static readonly PacketPool instance = new PacketPool(); - - public static PacketPool Instance + public Packet GetPacket(PacketType type) { - get - { - return instance; - } - } - - private Hashtable pool = new Hashtable(); - - public Packet GetPacket(PacketType type) { Packet packet = null; - lock(pool) + lock (pool) { - if(pool[type] == null || ((Stack) pool[type]).Count == 0) + if (pool[type] == null || ((Stack) pool[type]).Count == 0) { // Creating a new packet if we cannot reuse an old package packet = Packet.BuildPacket(type); @@ -104,14 +101,14 @@ namespace OpenSim.Framework else { // Recycle old packages - packet=(Packet) ((Stack) pool[type]).Pop(); + packet = (Packet) ((Stack) pool[type]).Pop(); } } return packet; } - // private byte[] decoded_header = new byte[10]; + // private byte[] decoded_header = new byte[10]; private PacketType GetType(byte[] bytes) { byte[] decoded_header = new byte[10 + 8]; @@ -120,7 +117,7 @@ namespace OpenSim.Framework Buffer.BlockCopy(bytes, 0, decoded_header, 0, 10); - if((bytes[0] & Helpers.MSG_ZEROCODED)!=0) + if ((bytes[0] & Helpers.MSG_ZEROCODED) != 0) { Helpers.ZeroDecodeCommand(bytes, decoded_header); } @@ -129,21 +126,21 @@ namespace OpenSim.Framework { if (decoded_header[7] == 0xFF) { - id = (ushort)((decoded_header[8] << 8) + decoded_header[9]); + id = (ushort) ((decoded_header[8] << 8) + decoded_header[9]); freq = PacketFrequency.Low; } else { - id = (ushort)decoded_header[7]; + id = (ushort) decoded_header[7]; freq = PacketFrequency.Medium; } } else { - id = (ushort)decoded_header[6]; + id = (ushort) decoded_header[6]; freq = PacketFrequency.High; } - + return Packet.GetType(id, freq); } @@ -157,7 +154,8 @@ namespace OpenSim.Framework return packet; } - public void ReturnPacket(Packet packet) { + public void ReturnPacket(Packet packet) + { return; // packet pool disabled /* // Commented out to remove a compiler warning. :) @@ -177,4 +175,4 @@ namespace OpenSim.Framework */ } } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/PrimitiveBaseShape.cs b/OpenSim/Framework/PrimitiveBaseShape.cs index 4243300..6607c4b 100644 --- a/OpenSim/Framework/PrimitiveBaseShape.cs +++ b/OpenSim/Framework/PrimitiveBaseShape.cs @@ -202,7 +202,7 @@ namespace OpenSim.Framework public void SetRadius(float radius) { - Scale.X = Scale.Y = radius*2f; + Scale.X = Scale.Y = radius * 2f; } // TODO: void returns need to change of course @@ -237,4 +237,4 @@ namespace OpenSim.Framework ProfileEnd = LLObject.PackEndCut(profileRange.Y); } } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/RegionCommsListener.cs b/OpenSim/Framework/RegionCommsListener.cs index 73971ac..422c939 100644 --- a/OpenSim/Framework/RegionCommsListener.cs +++ b/OpenSim/Framework/RegionCommsListener.cs @@ -33,6 +33,21 @@ namespace OpenSim.Framework { public class RegionCommsListener : IRegionCommsListener { + public string debugRegionName = String.Empty; + private AcknowledgeAgentCross handlerAcknowledgeAgentCrossed = null; // OnAcknowledgeAgentCrossed; + private AcknowledgePrimCross handlerAcknowledgePrimCrossed = null; // OnAcknowledgePrimCrossed; + private AgentCrossing handlerAvatarCrossingIntoRegion = null; // OnAvatarCrossingIntoRegion; + private ChildAgentUpdate handlerChildAgentUpdate = null; // OnChildAgentUpdate; + private CloseAgentConnection handlerCloseAgentConnection = null; // OnCloseAgentConnection; + private GenericCall2 handlerExpectChildAgent = null; // OnExpectChildAgent; + private ExpectPrimDelegate handlerExpectPrim = null; // OnExpectPrim; + private ExpectUserDelegate handlerExpectUser = null; // OnExpectUser + private UpdateNeighbours handlerNeighboursUpdate = null; // OnNeighboursUpdate; + private PrimCrossing handlerPrimCrossingIntoRegion = null; // OnPrimCrossingIntoRegion; + private RegionUp handlerRegionUp = null; // OnRegionUp; + + #region IRegionCommsListener Members + public event ExpectUserDelegate OnExpectUser; public event ExpectPrimDelegate OnExpectPrim; public event GenericCall2 OnExpectChildAgent; @@ -45,20 +60,7 @@ namespace OpenSim.Framework public event RegionUp OnRegionUp; public event ChildAgentUpdate OnChildAgentUpdate; - private ExpectUserDelegate handlerExpectUser = null; // OnExpectUser - private ExpectPrimDelegate handlerExpectPrim = null; // OnExpectPrim; - private GenericCall2 handlerExpectChildAgent = null; // OnExpectChildAgent; - private AgentCrossing handlerAvatarCrossingIntoRegion = null; // OnAvatarCrossingIntoRegion; - private PrimCrossing handlerPrimCrossingIntoRegion = null; // OnPrimCrossingIntoRegion; - private UpdateNeighbours handlerNeighboursUpdate = null; // OnNeighboursUpdate; - private AcknowledgeAgentCross handlerAcknowledgeAgentCrossed = null; // OnAcknowledgeAgentCrossed; - private AcknowledgePrimCross handlerAcknowledgePrimCrossed = null; // OnAcknowledgePrimCrossed; - private CloseAgentConnection handlerCloseAgentConnection = null; // OnCloseAgentConnection; - private RegionUp handlerRegionUp = null; // OnRegionUp; - private ChildAgentUpdate handlerChildAgentUpdate = null; // OnChildAgentUpdate; - - public string debugRegionName = String.Empty; - + #endregion /// /// @@ -164,7 +166,6 @@ namespace OpenSim.Framework { handlerCloseAgentConnection(regionHandle, agentID); return true; - } return false; } @@ -213,4 +214,4 @@ namespace OpenSim.Framework return false; } } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/RegionHandle.cs b/OpenSim/Framework/RegionHandle.cs index dcb5a43..f55f085 100644 --- a/OpenSim/Framework/RegionHandle.cs +++ b/OpenSim/Framework/RegionHandle.cs @@ -146,4 +146,4 @@ namespace OpenSim.Framework return y; } } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs index 20a2709..88c9ea6 100644 --- a/OpenSim/Framework/RegionInfo.cs +++ b/OpenSim/Framework/RegionInfo.cs @@ -37,9 +37,26 @@ namespace OpenSim.Framework [Serializable] public class SimpleRegionInfo { - // private static readonly log4net.ILog m_log - // = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - + // private static readonly log4net.ILog m_log + // = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); + + protected bool Allow_Alternate_Ports; + public bool m_allow_alternate_ports; + protected string m_externalHostName; + + /// + /// The port by which http communication occurs with the region (most noticeably, CAPS communication) + /// + protected uint m_httpPort; + + protected IPEndPoint m_internalEndPoint; + protected uint? m_regionLocX; + protected uint? m_regionLocY; + protected uint m_remotingPort; + protected string m_serverURI; + public LLUUID RegionID = LLUUID.Zero; + public string RemotingAddress; + public SimpleRegionInfo() { } @@ -74,52 +91,27 @@ namespace OpenSim.Framework m_allow_alternate_ports = ConvertFrom.m_allow_alternate_ports; RemotingAddress = ConvertFrom.RemotingAddress; RegionID = LLUUID.Zero; - ServerURI = ConvertFrom.ServerURI; + ServerURI = ConvertFrom.ServerURI; } - public LLUUID RegionID = LLUUID.Zero; - - protected uint m_remotingPort; - public uint RemotingPort { get { return m_remotingPort; } set { m_remotingPort = value; } } - - /// - /// The port by which http communication occurs with the region (most noticeably, CAPS communication) - /// - protected uint m_httpPort; + public uint HttpPort { get { return m_httpPort; } set { m_httpPort = value; } } - - public bool m_allow_alternate_ports; - - protected string m_serverURI; - - public int getInternalEndPointPort() - { - return m_internalEndPoint.Port; - } public string ServerURI { - get - { - return m_serverURI; - } - set - { - m_serverURI = value; - } + get { return m_serverURI; } + set { m_serverURI = value; } } - public string RemotingAddress; - /// /// This accessor can throw all the exceptions that Dns.GetHostAddresses can throw. /// @@ -139,7 +131,7 @@ namespace OpenSim.Framework // Reset for next check ia = null; - + foreach (IPAddress Adr in Dns.GetHostAddresses(m_externalHostName)) { if (ia == null) @@ -158,33 +150,24 @@ namespace OpenSim.Framework set { m_externalHostName = value.ToString(); } } - protected string m_externalHostName; public string ExternalHostName { get { return m_externalHostName; } set { m_externalHostName = value; } } - protected bool Allow_Alternate_Ports; - - protected IPEndPoint m_internalEndPoint; - public IPEndPoint InternalEndPoint { get { return m_internalEndPoint; } set { m_internalEndPoint = value; } } - protected uint? m_regionLocX; - public uint RegionLocX { get { return m_regionLocX.Value; } set { m_regionLocX = value; } } - protected uint? m_regionLocY; - public uint RegionLocY { get { return m_regionLocY.Value; } @@ -193,49 +176,39 @@ namespace OpenSim.Framework public ulong RegionHandle { - get { return Util.UIntsToLong((RegionLocX * (uint)Constants.RegionSize), (RegionLocY * (uint)Constants.RegionSize)); } + get { return Util.UIntsToLong((RegionLocX * (uint) Constants.RegionSize), (RegionLocY * (uint) Constants.RegionSize)); } + } + + public int getInternalEndPointPort() + { + return m_internalEndPoint.Port; } } public class RegionInfo : SimpleRegionInfo { - // private static readonly log4net.ILog m_log - // = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - - public string RegionName = String.Empty; + // private static readonly log4net.ILog m_log + // = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); + public bool commFailTF = false; + public ConfigurationMember configMember; + public LLUUID CovenantID = LLUUID.Zero; public string DataStore = String.Empty; public bool isSandbox = false; - public bool commFailTF = false; + private EstateSettings m_estateSettings; // public bool m_allow_alternate_ports; public LLUUID MasterAvatarAssignedUUID = LLUUID.Zero; - public LLUUID CovenantID = LLUUID.Zero; public string MasterAvatarFirstName = String.Empty; public string MasterAvatarLastName = String.Empty; public string MasterAvatarSandboxPassword = String.Empty; - public string regionSecret = LLUUID.Random().ToString(); - public string proxyUrl = ""; public LLUUID originRegionID = LLUUID.Zero; + public string proxyUrl = ""; + public string RegionName = String.Empty; + public string regionSecret = LLUUID.Random().ToString(); // Apparently, we're applying the same estatesettings regardless of whether it's local or remote. - private EstateSettings m_estateSettings; - - public EstateSettings EstateSettings - { - get - { - if (m_estateSettings == null) - { - m_estateSettings = new EstateSettings(); - } - - return m_estateSettings; - } - } - - public ConfigurationMember configMember; public RegionInfo(string description, string filename, bool skipConsoleConfig) { @@ -286,15 +259,27 @@ namespace OpenSim.Framework m_allow_alternate_ports = ConvertFrom.m_allow_alternate_ports; RemotingAddress = ConvertFrom.RemotingAddress; RegionID = LLUUID.Zero; - ServerURI = ConvertFrom.ServerURI; + ServerURI = ConvertFrom.ServerURI; } - + + public EstateSettings EstateSettings + { + get + { + if (m_estateSettings == null) + { + m_estateSettings = new EstateSettings(); + } + + return m_estateSettings; + } + } + public void SetEndPoint(string ipaddr, int port) { IPAddress tmpIP = IPAddress.Parse(ipaddr); - IPEndPoint tmpEPE= new IPEndPoint(tmpIP, port); + IPEndPoint tmpEPE = new IPEndPoint(tmpIP, port); m_internalEndPoint = tmpEPE; - } //not in use, should swap to nini though. @@ -351,8 +336,9 @@ namespace OpenSim.Framework return true; } - public void SaveRegionToFile(string description, string filename) { - configMember = new ConfigurationMember(filename, description, loadConfigurationOptionsFromMe, + public void SaveRegionToFile(string description, string filename) + { + configMember = new ConfigurationMember(filename, description, loadConfigurationOptionsFromMe, ignoreIncomingConfiguration, false); configMember.performConfigurationRetrieve(); } @@ -371,13 +357,13 @@ namespace OpenSim.Framework //configMember.addConfigurationOption("datastore", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Filename for local storage", "OpenSim.db", false); configMember.addConfigurationOption("internal_ip_address", ConfigurationOption.ConfigurationTypes.TYPE_IP_ADDRESS, - "Internal IP Address for incoming UDP client connections", + "Internal IP Address for incoming UDP client connections", m_internalEndPoint.Address.ToString(), true); configMember.addConfigurationOption("internal_ip_port", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "Internal IP Port for incoming UDP client connections", m_internalEndPoint.Port.ToString(), true); - configMember.addConfigurationOption("allow_alternate_ports", + configMember.addConfigurationOption("allow_alternate_ports", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN, "Allow sim to find alternate UDP ports when ports are in use?", m_allow_alternate_ports.ToString(), true); @@ -396,7 +382,7 @@ namespace OpenSim.Framework ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Last Name of Master Avatar", MasterAvatarLastName, true); configMember.addConfigurationOption("master_avatar_pass", ConfigurationOption.ConfigurationTypes.TYPE_STRING, - "(Sandbox Mode Only)Password for Master Avatar account", + "(Sandbox Mode Only)Password for Master Avatar account", MasterAvatarSandboxPassword, true); } @@ -461,7 +447,7 @@ namespace OpenSim.Framework { case "sim_UUID": RegionID = (LLUUID) configuration_result; - originRegionID = (LLUUID)configuration_result; + originRegionID = (LLUUID) configuration_result; break; case "sim_name": RegionName = (string) configuration_result; @@ -480,10 +466,10 @@ namespace OpenSim.Framework m_internalEndPoint = new IPEndPoint(address, 0); break; case "internal_ip_port": - m_internalEndPoint.Port = (int)configuration_result; + m_internalEndPoint.Port = (int) configuration_result; break; case "allow_alternate_ports": - m_allow_alternate_ports = (bool)configuration_result; + m_allow_alternate_ports = (bool) configuration_result; break; case "external_host_name": if ((string) configuration_result != "SYSTEMIP") @@ -517,9 +503,9 @@ namespace OpenSim.Framework return true; } - public void SaveEstatecovenantUUID(LLUUID notecard) + public void SaveEstatecovenantUUID(LLUUID notecard) { configMember.forceSetConfigurationOption("estate_covanant_uuid", notecard.ToString()); } } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/RegionUpData.cs b/OpenSim/Framework/RegionUpData.cs index 6162171..40f3164 100644 --- a/OpenSim/Framework/RegionUpData.cs +++ b/OpenSim/Framework/RegionUpData.cs @@ -32,10 +32,11 @@ namespace OpenSim.Framework [Serializable] public class RegionUpData { - private uint m_X = 0; - private uint m_Y = 0; private string m_ipaddr = ""; private int m_port = 0; + private uint m_X = 0; + private uint m_Y = 0; + public RegionUpData(uint X, uint Y, string ipaddr, int port) { m_X = X; @@ -48,17 +49,20 @@ namespace OpenSim.Framework { get { return m_X; } } + public uint Y { get { return m_Y; } } + public string IPADDR { get { return m_ipaddr; } } + public int PORT { - get { return m_port; } + get { return m_port; } } } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/Remoting.cs b/OpenSim/Framework/Remoting.cs index 5097d9c..7f18221 100644 --- a/OpenSim/Framework/Remoting.cs +++ b/OpenSim/Framework/Remoting.cs @@ -108,7 +108,7 @@ namespace OpenSim.Framework byte[] bytes = new byte[64]; RNG.GetBytes(bytes); - StringBuilder sb = new StringBuilder(bytes.Length*2); + StringBuilder sb = new StringBuilder(bytes.Length * 2); foreach (byte b in bytes) { sb.AppendFormat("{0:x2}", b); @@ -131,4 +131,4 @@ namespace OpenSim.Framework return c; } } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/SerializableInventory.cs b/OpenSim/Framework/SerializableInventory.cs index 8193fa7..81f993c 100644 --- a/OpenSim/Framework/SerializableInventory.cs +++ b/OpenSim/Framework/SerializableInventory.cs @@ -39,16 +39,20 @@ namespace OpenSim.Framework [XmlRoot(ElementName = "inventory", IsNullable = true)] public class SerializableInventory { + [XmlElement(ElementName = "folder", IsNullable = true)] public SerializableFolder root; + + #region Nested type: SerializableFolder + [XmlRoot(ElementName = "folder", IsNullable = true)] public class SerializableFolder : InventoryFolderBase { - [XmlArray(ElementName = "folders", IsNullable = true)] [XmlArrayItem(ElementName = "folder", IsNullable = true, Type = typeof (SerializableFolder))] public - ArrayList SubFolders; - [XmlArray(ElementName = "items", IsNullable = true)] [XmlArrayItem(ElementName = "item", IsNullable = true, Type = typeof (InventoryItemBase))] public ArrayList Items; + + [XmlArray(ElementName = "folders", IsNullable = true)] [XmlArrayItem(ElementName = "folder", IsNullable = true, Type = typeof (SerializableFolder))] public + ArrayList SubFolders; } - [XmlElement(ElementName = "folder", IsNullable = true)] public SerializableFolder root; + #endregion } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/SerializableRegionInfo.cs b/OpenSim/Framework/SerializableRegionInfo.cs index 2c73da8..97aa8db 100644 --- a/OpenSim/Framework/SerializableRegionInfo.cs +++ b/OpenSim/Framework/SerializableRegionInfo.cs @@ -35,6 +35,28 @@ namespace OpenSim.Framework [Serializable] public class SearializableRegionInfo { + public bool m_allow_alternate_ports; + protected string m_externalHostName; + + /// + /// The port by which http communication occurs with the region (most noticeably, CAPS communication) + /// + /// FIXME: Defaulting to 9000 temporarily (on the basis that this is the http port most region + /// servers are running) until the revision in which this change is made propogates around grids. + /// + protected uint m_httpPort = 9000; + + protected IPEndPoint m_internalEndPoint; + protected Guid m_originRegionID = LLUUID.Zero.UUID; + protected string m_proxyUrl; + protected uint? m_regionLocX; + protected uint? m_regionLocY; + protected string m_regionName; + public uint m_remotingPort; + protected string m_serverURI; + public Guid RegionID = LLUUID.Zero.UUID; + public string RemotingAddress; + /// /// This is a serializable version of RegionInfo /// @@ -52,7 +74,7 @@ namespace OpenSim.Framework m_httpPort = ConvertFrom.HttpPort; m_allow_alternate_ports = ConvertFrom.m_allow_alternate_ports; RemotingAddress = ConvertFrom.RemotingAddress; - m_proxyUrl = ConvertFrom.proxyUrl; + m_proxyUrl = ConvertFrom.proxyUrl; OriginRegionID = ConvertFrom.originRegionID; RegionName = ConvertFrom.RegionName; ServerURI = ConvertFrom.ServerURI; @@ -77,31 +99,17 @@ namespace OpenSim.Framework m_internalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), (int) port); } - public Guid RegionID = LLUUID.Zero.UUID; - - public uint m_remotingPort; public uint RemotingPort { get { return m_remotingPort; } set { m_remotingPort = value; } } - - /// - /// The port by which http communication occurs with the region (most noticeably, CAPS communication) - /// - /// FIXME: Defaulting to 9000 temporarily (on the basis that this is the http port most region - /// servers are running) until the revision in which this change is made propogates around grids. - /// - protected uint m_httpPort = 9000; + public uint HttpPort { get { return m_httpPort; } set { m_httpPort = value; } - } - - public bool m_allow_alternate_ports; - - public string RemotingAddress; + } public IPEndPoint ExternalEndPoint { @@ -138,32 +146,24 @@ namespace OpenSim.Framework set { m_externalHostName = value.ToString(); } } - protected string m_externalHostName; - public string ExternalHostName { get { return m_externalHostName; } set { m_externalHostName = value; } } - protected IPEndPoint m_internalEndPoint; - public IPEndPoint InternalEndPoint { get { return m_internalEndPoint; } set { m_internalEndPoint = value; } } - protected uint? m_regionLocX; - public uint RegionLocX { get { return m_regionLocX.Value; } set { m_regionLocX = value; } } - protected uint? m_regionLocY; - public uint RegionLocY { get { return m_regionLocY.Value; } @@ -172,59 +172,31 @@ namespace OpenSim.Framework public ulong RegionHandle { - get { return Util.UIntsToLong((RegionLocX * (uint)Constants.RegionSize), (RegionLocY * (uint)Constants.RegionSize)); } + get { return Util.UIntsToLong((RegionLocX * (uint) Constants.RegionSize), (RegionLocY * (uint) Constants.RegionSize)); } } - protected string m_proxyUrl; public string ProxyUrl { - get - { - return m_proxyUrl; - } - set - { - m_proxyUrl = value; - } + get { return m_proxyUrl; } + set { m_proxyUrl = value; } } - protected Guid m_originRegionID = LLUUID.Zero.UUID; public LLUUID OriginRegionID { - get - { - return new LLUUID(m_originRegionID); - } - set - { - m_originRegionID = value.UUID; - } + get { return new LLUUID(m_originRegionID); } + set { m_originRegionID = value.UUID; } } - protected string m_regionName; public string RegionName { - get - { - return m_regionName; - } - set - { - m_regionName = value; - } + get { return m_regionName; } + set { m_regionName = value; } } - protected string m_serverURI; public string ServerURI { - get - { - return m_serverURI; - } - set - { - m_serverURI = value; - } + get { return m_serverURI; } + set { m_serverURI = value; } } } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/TaskInventoryItem.cs b/OpenSim/Framework/TaskInventoryItem.cs index 615644b..d01c4c1 100644 --- a/OpenSim/Framework/TaskInventoryItem.cs +++ b/OpenSim/Framework/TaskInventoryItem.cs @@ -35,19 +35,38 @@ using libsecondlife; using log4net; namespace OpenSim.Framework -{ +{ /// /// A dictionary for task inventory. /// /// This class is not thread safe. Callers must synchronize on Dictionary methods. /// - public class TaskInventoryDictionary : Dictionary, - ICloneable, IXmlSerializable + public class TaskInventoryDictionary : Dictionary, + ICloneable, IXmlSerializable { - private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - - private static XmlSerializer tiiSerializer = new XmlSerializer(typeof(TaskInventoryItem)); - + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + + private static XmlSerializer tiiSerializer = new XmlSerializer(typeof (TaskInventoryItem)); + + #region ICloneable Members + + public Object Clone() + { + TaskInventoryDictionary clone = new TaskInventoryDictionary(); + + lock (this) + { + foreach (LLUUID uuid in Keys) + { + clone.Add(uuid, (TaskInventoryItem) this[uuid].Clone()); + } + } + + return clone; + } + + #endregion + // The alternative of simply serializing the list doesn't appear to work on mono, since // we get a // @@ -58,43 +77,46 @@ namespace OpenSim.Framework // ... // private static XmlSerializer tiiSerializer // = new XmlSerializer(typeof(Dictionary.ValueCollection)); - + // see IXmlSerializable + + #region IXmlSerializable Members + public XmlSchema GetSchema() { return null; } - + // see IXmlSerializable public void ReadXml(XmlReader reader) { - m_log.DebugFormat("[TASK INVENTORY]: ReadXml current node before actions, {0}", reader.Name); + m_log.DebugFormat("[TASK INVENTORY]: ReadXml current node before actions, {0}", reader.Name); if (!reader.IsEmptyElement) { reader.Read(); while (tiiSerializer.CanDeserialize(reader)) { - TaskInventoryItem item = (TaskInventoryItem)tiiSerializer.Deserialize(reader); + TaskInventoryItem item = (TaskInventoryItem) tiiSerializer.Deserialize(reader); Add(item.ItemID, item); - + m_log.DebugFormat("[TASK INVENTORY]: Instanted prim item {0}, {1} from xml", item.Name, item.ItemID); } - + m_log.DebugFormat("[TASK INVENTORY]: Instantiated {0} prim items in total from xml", Count); } else { m_log.DebugFormat("[TASK INVENTORY]: Skipping empty element {0}", reader.Name); } - + // For some .net implementations, this last read is necessary so that we advance beyond the end tag // of the element wrapping this object so that the rest of the serialization can complete normally. reader.Read(); - - m_log.DebugFormat("[TASK INVENTORY]: ReadXml current node after actions, {0}", reader.Name); + + m_log.DebugFormat("[TASK INVENTORY]: ReadXml current node after actions, {0}", reader.Name); } - + // see IXmlSerializable public void WriteXml(XmlWriter writer) { @@ -105,27 +127,15 @@ namespace OpenSim.Framework tiiSerializer.Serialize(writer, item); } } - + //tiiSerializer.Serialize(writer, Values); } - + + #endregion + // see ICloneable - public Object Clone() - { - TaskInventoryDictionary clone = new TaskInventoryDictionary(); - - lock (this) - { - foreach (LLUUID uuid in Keys) - { - clone.Add(uuid, (TaskInventoryItem)this[uuid].Clone()); - } - } - - return clone; - } } - + /// /// Represents an item in a task inventory /// @@ -135,90 +145,99 @@ namespace OpenSim.Framework /// XXX This should really be factored out into some constants class. /// private const uint FULL_MASK_PERMISSIONS_GENERAL = 2147483647; - + /// /// Inventory types /// public static string[] InvTypes = new string[] - { - "texture", - "sound", - "calling_card", - "landmark", - String.Empty, - String.Empty, - "object", - "notecard", - String.Empty, - String.Empty, - "lsl_text", - String.Empty, - String.Empty, - "bodypart", - String.Empty, - "snapshot", - String.Empty, - String.Empty, - "wearable", - "animation", - "gesture" - - }; - + { + "texture", + "sound", + "calling_card", + "landmark", + String.Empty, + String.Empty, + "object", + "notecard", + String.Empty, + String.Empty, + "lsl_text", + String.Empty, + String.Empty, + "bodypart", + String.Empty, + "snapshot", + String.Empty, + String.Empty, + "wearable", + "animation", + "gesture" + }; + /// /// Asset types /// public static string[] Types = new string[] - { - "texture", - "sound", - "callcard", - "landmark", - "clothing", // Deprecated - "clothing", - "object", - "notecard", - "category", - "root", - "lsltext", - "lslbyte", - "txtr_tga", - "bodypart", - "trash", - "snapshot", - "lstndfnd", - "snd_wav", - "img_tga", - "jpeg", - "animatn", - "gesture" - }; + { + "texture", + "sound", + "callcard", + "landmark", + "clothing", // Deprecated + "clothing", + "object", + "notecard", + "category", + "root", + "lsltext", + "lslbyte", + "txtr_tga", + "bodypart", + "trash", + "snapshot", + "lstndfnd", + "snd_wav", + "img_tga", + "jpeg", + "animatn", + "gesture" + }; - public LLUUID ItemID = LLUUID.Zero; - public LLUUID ParentID = LLUUID.Zero; //parent folder id + public LLUUID AssetID = LLUUID.Zero; public uint BaseMask = FULL_MASK_PERMISSIONS_GENERAL; - public uint OwnerMask = FULL_MASK_PERMISSIONS_GENERAL; - public uint GroupMask = FULL_MASK_PERMISSIONS_GENERAL; - public uint EveryoneMask = FULL_MASK_PERMISSIONS_GENERAL; - public uint NextOwnerMask = FULL_MASK_PERMISSIONS_GENERAL; + public uint CreationDate = 0; public LLUUID CreatorID = LLUUID.Zero; - public LLUUID OwnerID = LLUUID.Zero; - public LLUUID LastOwnerID = LLUUID.Zero; + public string Description = String.Empty; + public uint EveryoneMask = FULL_MASK_PERMISSIONS_GENERAL; + public uint Flags = 0; public LLUUID GroupID = LLUUID.Zero; + public uint GroupMask = FULL_MASK_PERMISSIONS_GENERAL; - public LLUUID AssetID = LLUUID.Zero; - public int Type = 0; public int InvType = 0; - public uint Flags = 0; + public LLUUID ItemID = LLUUID.Zero; + public LLUUID LastOwnerID = LLUUID.Zero; public string Name = String.Empty; - public string Description = String.Empty; - public uint CreationDate = 0; + public uint NextOwnerMask = FULL_MASK_PERMISSIONS_GENERAL; + public LLUUID OwnerID = LLUUID.Zero; + public uint OwnerMask = FULL_MASK_PERMISSIONS_GENERAL; + public LLUUID ParentID = LLUUID.Zero; //parent folder id + public LLUUID ParentPartID = LLUUID.Zero; public LLUUID PermsGranter; public int PermsMask; + public int Type = 0; + + // See ICloneable + + #region ICloneable Members + + public Object Clone() + { + return MemberwiseClone(); + } + + #endregion - public LLUUID ParentPartID = LLUUID.Zero; - /// /// Reset the LLUUIDs for this item. /// @@ -227,12 +246,6 @@ namespace OpenSim.Framework { ItemID = LLUUID.Random(); ParentPartID = partID; - } - - // See ICloneable - public Object Clone() - { - return MemberwiseClone(); } } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/ThreadTracker.cs b/OpenSim/Framework/ThreadTracker.cs index 8fe5b82..b87e180 100644 --- a/OpenSim/Framework/ThreadTracker.cs +++ b/OpenSim/Framework/ThreadTracker.cs @@ -34,9 +34,9 @@ namespace OpenSim.Framework { public static class ThreadTracker { + private static readonly long ThreadTimeout = 30 * 10000000; public static List m_Threads; public static Thread ThreadTrackerThread; - private static readonly long ThreadTimeout = 30 * 10000000; static ThreadTracker() { @@ -123,10 +123,14 @@ namespace OpenSim.Framework return threads; } + #region Nested type: ThreadTrackerItem + public class ThreadTrackerItem { - public Thread Thread; public long LastSeenActive; + public Thread Thread; } + + #endregion } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/UndoStack.cs b/OpenSim/Framework/UndoStack.cs index 0b97644..a49a0cc 100644 --- a/OpenSim/Framework/UndoStack.cs +++ b/OpenSim/Framework/UndoStack.cs @@ -26,8 +26,6 @@ */ using System; -using System.Collections.Generic; -using System.Text; namespace OpenSim.Framework { @@ -38,35 +36,39 @@ namespace OpenSim.Framework [Serializable] public class UndoStack { - private int m_new = 1; private int m_old = 0; private T[] m_Undos; + public UndoStack(int capacity) + { + m_Undos = new T[capacity + 1]; + } + public bool IsFull { - get - { - return m_new == m_old; - } + get { return m_new == m_old; } } public int Capacity { + get { return m_Undos.Length - 1; } + } + + public int Count + { get { - return m_Undos.Length - 1; + int count = m_new - m_old - 1; + if (count < 0) + count += m_Undos.Length; + return count; } } - - public UndoStack(int capacity) - { - m_Undos = new T[capacity + 1]; - } - public void Push(T item) + public void Push(T item) { if (IsFull) { @@ -93,24 +95,13 @@ namespace OpenSim.Framework throw new InvalidOperationException("Cannot pop from emtpy stack"); } - public int Count - { - get - { - int count = m_new - m_old - 1; - if (count < 0) - count += m_Undos.Length; - return count; - } - } - public T Peek() { return m_Undos[m_new]; } - + public void Clear() { if (Count > 0) @@ -123,6 +114,5 @@ namespace OpenSim.Framework m_old = 0; } } - } } \ No newline at end of file diff --git a/OpenSim/Framework/UserAgentData.cs b/OpenSim/Framework/UserAgentData.cs index e4dd658..de09ce2 100644 --- a/OpenSim/Framework/UserAgentData.cs +++ b/OpenSim/Framework/UserAgentData.cs @@ -36,41 +36,34 @@ namespace OpenSim.Framework public class UserAgentData { /// - /// The UUID of the users avatar (not the agent!) - /// - private LLUUID UUID; - - /// /// The IP address of the user /// private string agentIP = String.Empty; /// - /// The port of the user - + /// Is the user online? /// - private uint agentPort; + private bool agentOnline; /// - /// Is the user online? + /// The port of the user /// - private bool agentOnline; + private uint agentPort; /// - /// The session ID for the user (also the agent ID) + /// Region handle of the current region the user is in /// - private LLUUID sessionID; + private ulong currentHandle; /// - /// The "secure" session ID for the user + /// The position of the user within the region /// - /// Not very secure. Dont rely on it for anything more than Linden Lab does. - private LLUUID secureSessionID; + private LLVector3 currentPos; /// - /// The region the user logged into initially + /// Current region the user is logged into /// - private LLUUID regionID; + private LLUUID currentRegion; /// /// A unix timestamp from when the user logged in @@ -83,139 +76,114 @@ namespace OpenSim.Framework private int logoutTime; /// - /// Current region the user is logged into + /// The region the user logged into initially /// - private LLUUID currentRegion; + private LLUUID regionID; /// - /// Region handle of the current region the user is in + /// The "secure" session ID for the user /// - private ulong currentHandle; + /// Not very secure. Dont rely on it for anything more than Linden Lab does. + private LLUUID secureSessionID; /// - /// The position of the user within the region + /// The session ID for the user (also the agent ID) /// - private LLVector3 currentPos; - - public LLUUID ProfileID { - get { - return UUID; - } - set { - UUID = value; - } + private LLUUID sessionID; + + /// + /// The UUID of the users avatar (not the agent!) + /// + private LLUUID UUID; + + public LLUUID ProfileID + { + get { return UUID; } + set { UUID = value; } } - public string AgentIP { - get { - return agentIP; - } - set { - agentIP = value; - } + public string AgentIP + { + get { return agentIP; } + set { agentIP = value; } } - public uint AgentPort { - get { - return agentPort; - } - set { - agentPort = value; - } + public uint AgentPort + { + get { return agentPort; } + set { agentPort = value; } } - public bool AgentOnline { - get { - return agentOnline; - } - set { - agentOnline = value; - } + public bool AgentOnline + { + get { return agentOnline; } + set { agentOnline = value; } } - public LLUUID SessionID { - get { - return sessionID; - } - set { - sessionID = value; - } + public LLUUID SessionID + { + get { return sessionID; } + set { sessionID = value; } } - public LLUUID SecureSessionID { - get { - return secureSessionID; - } - set { - secureSessionID = value; - } + public LLUUID SecureSessionID + { + get { return secureSessionID; } + set { secureSessionID = value; } } - public LLUUID InitialRegion { - get { - return regionID; - } - set { - regionID = value; - } + public LLUUID InitialRegion + { + get { return regionID; } + set { regionID = value; } } - public int LoginTime { - get { - return loginTime; - } - set { - loginTime = value; - } + public int LoginTime + { + get { return loginTime; } + set { loginTime = value; } } - public int LogoutTime { - get { - return logoutTime; - } - set { - logoutTime = value; - } + public int LogoutTime + { + get { return logoutTime; } + set { logoutTime = value; } } - public LLUUID Region { - get { - return currentRegion; - } - set { - currentRegion = value; - } + public LLUUID Region + { + get { return currentRegion; } + set { currentRegion = value; } } - public ulong Handle { - get { - return currentHandle; - } - set { - currentHandle = value; - } + public ulong Handle + { + get { return currentHandle; } + set { currentHandle = value; } } - public LLVector3 Position { - get { - return currentPos; - } - set { - currentPos = value; - } + public LLVector3 Position + { + get { return currentPos; } + set { currentPos = value; } } - public float PositionX { + public float PositionX + { get { return currentPos.X; } set { currentPos.X = value; } } - public float PositionY { + + public float PositionY + { get { return currentPos.Y; } set { currentPos.Y = value; } } - public float PositionZ { + + public float PositionZ + { get { return currentPos.Z; } set { currentPos.Z = value; } } } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/UserConfig.cs b/OpenSim/Framework/UserConfig.cs index 8ae8f7e..c176bbf 100644 --- a/OpenSim/Framework/UserConfig.cs +++ b/OpenSim/Framework/UserConfig.cs @@ -34,28 +34,24 @@ namespace OpenSim.Framework /// public class UserConfig { - public string DefaultStartupMsg = String.Empty; - public string GridServerURL = String.Empty; - public string GridSendKey = String.Empty; - public string GridRecvKey = String.Empty; - - public string InventoryUrl = String.Empty; - - public string DatabaseProvider = String.Empty; - public static uint DefaultHttpPort = 8002; public static bool DefaultHttpSSL = false; - public uint HttpPort = DefaultHttpPort; - public bool HttpSSL = DefaultHttpSSL; + private ConfigurationMember configMember; + public string DatabaseProvider = String.Empty; + public string DefaultStartupMsg = String.Empty; public uint DefaultX = 1000; public uint DefaultY = 1000; - - private ConfigurationMember configMember; + public string GridRecvKey = String.Empty; + public string GridSendKey = String.Empty; + public string GridServerURL = String.Empty; + public uint HttpPort = DefaultHttpPort; + public bool HttpSSL = DefaultHttpSSL; + public string InventoryUrl = String.Empty; public UserConfig(string description, string filename) { configMember = - new ConfigurationMember(filename, description, loadConfigurationOptions, handleIncomingConfiguration,true); + new ConfigurationMember(filename, description, loadConfigurationOptions, handleIncomingConfiguration, true); configMember.performConfigurationRetrieve(); } @@ -131,4 +127,4 @@ namespace OpenSim.Framework return true; } } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/UserProfileData.cs b/OpenSim/Framework/UserProfileData.cs index 254e903..b704682 100644 --- a/OpenSim/Framework/UserProfileData.cs +++ b/OpenSim/Framework/UserProfileData.cs @@ -36,39 +36,21 @@ namespace OpenSim.Framework public class UserProfileData { /// - /// The ID value for this user + /// A UNIX Timestamp (seconds since epoch) for the users creation /// - private LLUUID _id; + private int _created; /// - /// The last used Web_login_key + /// The users last registered agent (filled in on the user server) /// - private LLUUID _webLoginKey; + private UserAgentData _currentAgent; + /// /// The first component of a users account name /// private string _firstname; /// - /// The second component of a users account name - /// - private string _surname; - - /// - /// A salted hash containing the users password, in the format md5(md5(password) + ":" + salt) - /// - /// This is double MD5'd because the client sends an unsalted MD5 to the loginserver - private string _passwordHash; - - /// - /// The salt used for the users hash, should be 32 bytes or longer - /// - private string _passwordSalt; - - private uint _homeRegionX; - private uint _homeRegionY; - - /// /// The coordinates inside the region of the home location /// private LLVector3 _homeLocation; @@ -78,42 +60,44 @@ namespace OpenSim.Framework /// private LLVector3 _homeLookAt; + private uint _homeRegionX; + private uint _homeRegionY; + /// - /// A UNIX Timestamp (seconds since epoch) for the users creation + /// The ID value for this user /// - private int _created; + private LLUUID _id; /// /// A UNIX Timestamp for the users last login date / time /// private int _lastLogin; - private LLUUID _rootInventoryFolderID; - /// - /// A URI to the users inventory server, used for foreigners and large grids + /// A salted hash containing the users password, in the format md5(md5(password) + ":" + salt) /// - private string _userInventoryURI = String.Empty; + /// This is double MD5'd because the client sends an unsalted MD5 to the loginserver + private string _passwordHash; /// - /// A URI to the users asset server, used for foreigners and large grids. + /// The salt used for the users hash, should be 32 bytes or longer /// - private string _userAssetURI = String.Empty; + private string _passwordSalt; /// - /// A uint mask containing the "I can do" fields of the users profile + /// The about text listed in a users profile. /// - private uint _profileCanDoMask; + private string _profileAboutText = String.Empty; /// - /// A uint mask containing the "I want to do" part of the users profile + /// A uint mask containing the "I can do" fields of the users profile /// - private uint _profileWantDoMask; // Profile window "I want to" mask + private uint _profileCanDoMask; /// - /// The about text listed in a users profile. + /// The profile image for the users first life tab /// - private string _profileAboutText = String.Empty; + private LLUUID _profileFirstImage; /// /// The first life about text listed in a users profile @@ -126,21 +110,38 @@ namespace OpenSim.Framework private LLUUID _profileImage; /// - /// The profile image for the users first life tab + /// A uint mask containing the "I want to do" part of the users profile /// - private LLUUID _profileFirstImage; + private uint _profileWantDoMask; // Profile window "I want to" mask + + private LLUUID _rootInventoryFolderID; /// - /// The users last registered agent (filled in on the user server) + /// The second component of a users account name /// - private UserAgentData _currentAgent; + private string _surname; + + /// + /// A URI to the users asset server, used for foreigners and large grids. + /// + private string _userAssetURI = String.Empty; + + /// + /// A URI to the users inventory server, used for foreigners and large grids + /// + private string _userInventoryURI = String.Empty; + + /// + /// The last used Web_login_key + /// + private LLUUID _webLoginKey; /// /// The regionhandle of the users preffered home region. If multiple sims occupy the same spot, the grid may decide which region the user logs into /// public ulong HomeRegion { - get { return Helpers.UIntsToLong((_homeRegionX * (uint)Constants.RegionSize), (_homeRegionY * (uint)Constants.RegionSize)); } + get { return Helpers.UIntsToLong((_homeRegionX * (uint) Constants.RegionSize), (_homeRegionY * (uint) Constants.RegionSize)); } set { _homeRegionX = (uint) (value >> 40); @@ -149,232 +150,175 @@ namespace OpenSim.Framework } // Property wrappers - public LLUUID ID { - get { - return _id; - } - set { - _id = value; - } + public LLUUID ID + { + get { return _id; } + set { _id = value; } } - public LLUUID WebLoginKey { - get { - return _webLoginKey; - } - set { - _webLoginKey = value; - } + public LLUUID WebLoginKey + { + get { return _webLoginKey; } + set { _webLoginKey = value; } } - public string FirstName { - get { - return _firstname; - } - set { - _firstname = value; - } + public string FirstName + { + get { return _firstname; } + set { _firstname = value; } } - public string SurName { - get { - return _surname; - } - set { - _surname = value; - } + public string SurName + { + get { return _surname; } + set { _surname = value; } } - public string PasswordHash { - get { - return _passwordHash; - } - set { - _passwordHash = value; - } + public string PasswordHash + { + get { return _passwordHash; } + set { _passwordHash = value; } } - public string PasswordSalt { - get { - return _passwordSalt; - } - set { - _passwordSalt = value; - } + public string PasswordSalt + { + get { return _passwordSalt; } + set { _passwordSalt = value; } } - public uint HomeRegionX { - get { - return _homeRegionX; - } - set { - _homeRegionX = value; - } + public uint HomeRegionX + { + get { return _homeRegionX; } + set { _homeRegionX = value; } } - public uint HomeRegionY { - get { - return _homeRegionY; - } - set { - _homeRegionY = value; - } + public uint HomeRegionY + { + get { return _homeRegionY; } + set { _homeRegionY = value; } } - public LLVector3 HomeLocation { - get { - return _homeLocation; - } - set { - _homeLocation = value; - } + public LLVector3 HomeLocation + { + get { return _homeLocation; } + set { _homeLocation = value; } } // for handy serialization - public float HomeLocationX { + public float HomeLocationX + { get { return _homeLocation.X; } set { _homeLocation.X = value; } } - public float HomeLocationY { + + public float HomeLocationY + { get { return _homeLocation.Y; } set { _homeLocation.Y = value; } } - public float HomeLocationZ { + + public float HomeLocationZ + { get { return _homeLocation.Z; } set { _homeLocation.Z = value; } } - public LLVector3 HomeLookAt { - get { - return _homeLookAt; - } - set { - _homeLookAt = value; - } + public LLVector3 HomeLookAt + { + get { return _homeLookAt; } + set { _homeLookAt = value; } } - + // for handy serialization - public float HomeLookAtX { + public float HomeLookAtX + { get { return _homeLookAt.X; } set { _homeLookAt.X = value; } } - public float HomeLookAtY { + + public float HomeLookAtY + { get { return _homeLookAt.Y; } set { _homeLookAt.Y = value; } } - public float HomeLookAtZ { + + public float HomeLookAtZ + { get { return _homeLookAt.Z; } set { _homeLookAt.Z = value; } } - public int Created { - get { - return _created; - } - set { - _created = value; - } + public int Created + { + get { return _created; } + set { _created = value; } } - public int LastLogin { - get { - return _lastLogin; - } - set { - _lastLogin = value; - } + public int LastLogin + { + get { return _lastLogin; } + set { _lastLogin = value; } } - public LLUUID RootInventoryFolderID { - get { - return _rootInventoryFolderID; - } - set { - _rootInventoryFolderID = value; - } + public LLUUID RootInventoryFolderID + { + get { return _rootInventoryFolderID; } + set { _rootInventoryFolderID = value; } } - public string UserInventoryURI { - get { - return _userInventoryURI; - } - set { - _userInventoryURI = value; - } + public string UserInventoryURI + { + get { return _userInventoryURI; } + set { _userInventoryURI = value; } } - public string UserAssetURI { - get { - return _userAssetURI; - } - set { - _userAssetURI = value; - } + public string UserAssetURI + { + get { return _userAssetURI; } + set { _userAssetURI = value; } } - public uint CanDoMask { - get { - return _profileCanDoMask; - } - set { - _profileCanDoMask = value; - } + public uint CanDoMask + { + get { return _profileCanDoMask; } + set { _profileCanDoMask = value; } } - public uint WantDoMask { - get { - return _profileWantDoMask; - } - set { - _profileWantDoMask = value; - } + public uint WantDoMask + { + get { return _profileWantDoMask; } + set { _profileWantDoMask = value; } } - public string AboutText { - get { - return _profileAboutText; - } - set { - _profileAboutText = value; - } + public string AboutText + { + get { return _profileAboutText; } + set { _profileAboutText = value; } } - public string FirstLifeAboutText { - get { - return _profileFirstText; - } - set { - _profileFirstText = value; - } + public string FirstLifeAboutText + { + get { return _profileFirstText; } + set { _profileFirstText = value; } } - public LLUUID Image { - get { - return _profileImage; - } - set { - _profileImage = value; - } + public LLUUID Image + { + get { return _profileImage; } + set { _profileImage = value; } } - public LLUUID FirstLifeImage { - get { - return _profileFirstImage; - } - set { - _profileFirstImage = value; - } + public LLUUID FirstLifeImage + { + get { return _profileFirstImage; } + set { _profileFirstImage = value; } } - public UserAgentData CurrentAgent { - get { - return _currentAgent; - } - set { - _currentAgent = value; - } + public UserAgentData CurrentAgent + { + get { return _currentAgent; } + set { _currentAgent = value; } } - } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index 8114957..0943626 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs @@ -45,18 +45,17 @@ namespace OpenSim.Framework { public class Util { - private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - - private static Random randomClass = new Random(); - private static uint nextXferID = 5000; - private static object XferLock = new object(); + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - // Get a list of invalid path characters (OS dependent) - private static string regexInvalidPathChars = "[" + new String(Path.GetInvalidPathChars()) + "]"; + private static uint nextXferID = 5000; + private static Random randomClass = new Random(); // Get a list of invalid file characters (OS dependent) private static string regexInvalidFileChars = "[" + new String(Path.GetInvalidFileNameChars()) + "]"; + private static string regexInvalidPathChars = "[" + new String(Path.GetInvalidPathChars()) + "]"; + private static object XferLock = new object(); #region Vector Equasions + /// /// Get the distance between two 3d vectors /// @@ -92,7 +91,7 @@ namespace OpenSim.Framework if (IsZeroVector(a)) throw new ArgumentException("Vector paramater cannot be a zero vector."); - float Mag = (float)GetMagnitude(a); + float Mag = (float) GetMagnitude(a); return new LLVector3(a.X / Mag, a.Y / Mag, a.Z / Mag); } @@ -112,9 +111,8 @@ namespace OpenSim.Framework # endregion - public static ulong UIntsToLong(uint X, uint Y) + public Util() { - return Helpers.UIntsToLong(X, Y); } public static Random RandomClass @@ -122,6 +120,11 @@ namespace OpenSim.Framework get { return randomClass; } } + public static ulong UIntsToLong(uint X, uint Y) + { + return Helpers.UIntsToLong(X, Y); + } + public static uint GetNextXferID() { uint id = 0; @@ -133,10 +136,6 @@ namespace OpenSim.Framework return id; } - public Util() - { - } - public static string GetFileName(string file) { // Return just the filename on UNIX platforms @@ -199,7 +198,7 @@ namespace OpenSim.Framework public static int ToUnixTime(DateTime stamp) { TimeSpan t = (stamp.ToUniversalTime() - Convert.ToDateTime("1/1/1970 8:00:00 AM")); - return (int)t.TotalSeconds; + return (int) t.TotalSeconds; } public static DateTime ToDateTime(ulong seconds) @@ -309,7 +308,7 @@ namespace OpenSim.Framework for (int j = 0; j < 16 && (i + j) < bytes.Length; j++) { if (bytes[i + j] >= 0x20 && bytes[i + j] < 0x7E) - output.Append((char)bytes[i + j]); + output.Append((char) bytes[i + j]); else output.Append("."); } @@ -332,7 +331,7 @@ namespace OpenSim.Framework return ipa; IPAddress[] hosts = null; - + // Not an IP, lookup required try { @@ -341,7 +340,7 @@ namespace OpenSim.Framework catch (Exception e) { m_log.ErrorFormat("[UTIL]: An error occurred while resolving {0}, {1}", dnsAddress, e); - + // Still going to throw the exception on for now, since this was what was happening in the first place throw e; } @@ -397,7 +396,8 @@ namespace OpenSim.Framework /// safe filename public static string safeFileName(string filename) { - return Regex.Replace(filename, @regexInvalidFileChars, string.Empty); ; + return Regex.Replace(filename, @regexInvalidFileChars, string.Empty); + ; } // @@ -454,10 +454,10 @@ namespace OpenSim.Framework public static void AddDataRowToConfig(IConfigSource config, DataRow row) { - config.Configs.Add((string)row[0]); + config.Configs.Add((string) row[0]); for (int i = 0; i < row.Table.Columns.Count; i++) { - config.Configs[(string)row[0]].Set(row.Table.Columns[i].ColumnName, row[i]); + config.Configs[(string) row[0]].Set(row.Table.Columns[i].ColumnName, row[i]); } } @@ -594,19 +594,19 @@ namespace OpenSim.Framework returnstring[2] = "127"; returnstring[3] = "0"; // This is the crappy way of doing it. - + if (startLocationRequest.Contains(":") && startLocationRequest.Contains("&")) { //System.Console.WriteLine("StartLocationRequest Contains proper elements"); - string[] splitstr = startLocationRequest.Split(':');//,2,StringSplitOptions.RemoveEmptyEntries); - + string[] splitstr = startLocationRequest.Split(':'); //,2,StringSplitOptions.RemoveEmptyEntries); + //System.Console.WriteLine("Found " + splitstr.GetLength(0) + " elements in 1st split result"); - + if (splitstr.GetLength(0) == 2) { - string[] splitstr2 = splitstr[1].Split('&');//, 4, StringSplitOptions.RemoveEmptyEntries); - + string[] splitstr2 = splitstr[1].Split('&'); //, 4, StringSplitOptions.RemoveEmptyEntries); + //System.Console.WriteLine("Found " + splitstr2.GetLength(0) + " elements in 2nd split result"); int len = Math.Min(splitstr2.GetLength(0), 4); @@ -622,17 +622,16 @@ namespace OpenSim.Framework } return returnstring; } - - static public XmlRpcResponse XmlRpcCommand(string url, string methodName, params object[] args) + + public static XmlRpcResponse XmlRpcCommand(string url, string methodName, params object[] args) { return SendXmlRpcCommand(url, methodName, args); } - - static public XmlRpcResponse SendXmlRpcCommand(string url, string methodName, object[] args) + + public static XmlRpcResponse SendXmlRpcCommand(string url, string methodName, object[] args) { XmlRpcRequest client = new XmlRpcRequest(methodName, args); return client.Send(url, 6000); } - } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/sLLVector3.cs b/OpenSim/Framework/sLLVector3.cs index dca94b5..c0bafb2 100644 --- a/OpenSim/Framework/sLLVector3.cs +++ b/OpenSim/Framework/sLLVector3.cs @@ -33,6 +33,10 @@ namespace OpenSim.Framework [Serializable] public class sLLVector3 { + public float x = 0; + public float y = 0; + public float z = 0; + public sLLVector3() { } @@ -43,9 +47,5 @@ namespace OpenSim.Framework y = v.Y; z = v.Z; } - - public float x=0; - public float y=0; - public float z=0; } -} +} \ No newline at end of file -- cgit v1.1