From f7b28dd32155eac2d55ccf0757b059794d6b5f67 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 7 Sep 2010 03:41:29 +0100 Subject: If a scene object part UUID is changed (only possible when not in a scene), then adjust the inventory items to point to the new uuid as well --- OpenSim/Framework/TaskInventoryItem.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/TaskInventoryItem.cs b/OpenSim/Framework/TaskInventoryItem.cs index 2cb7895..df5b936 100644 --- a/OpenSim/Framework/TaskInventoryItem.cs +++ b/OpenSim/Framework/TaskInventoryItem.cs @@ -348,15 +348,15 @@ namespace OpenSim.Framework /// The new part ID to which this item belongs public void ResetIDs(UUID partID) { - _oldID = _itemID; - _itemID = UUID.Random(); - _parentPartID = partID; - _parentID = partID; + OldItemID = ItemID; + ItemID = UUID.Random(); + ParentPartID = partID; + ParentID = partID; } public TaskInventoryItem() { - _creationDate = (uint)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds; + CreationDate = (uint)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds; } } } -- cgit v1.1 From 9be1c0ff448d4ea650ca921937905653b4017d61 Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Tue, 7 Sep 2010 14:41:13 -0700 Subject: * Cache null account responses in the SimianUserAccountServiceConnector to avoid repeated requests for missing avatar IDs * Updated to OpenMetaverse r3442 to fix a timezone issue with ExpiringCache --- OpenSim/Framework/SLUtil.cs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/SLUtil.cs b/OpenSim/Framework/SLUtil.cs index a489806..9941a7f 100644 --- a/OpenSim/Framework/SLUtil.cs +++ b/OpenSim/Framework/SLUtil.cs @@ -46,7 +46,7 @@ namespace OpenSim.Framework case AssetType.Texture: return "image/x-j2c"; case AssetType.Sound: - return "application/ogg"; + return "audio/ogg"; case AssetType.CallingCard: return "application/vnd.ll.callingcard"; case AssetType.Landmark: @@ -98,8 +98,6 @@ namespace OpenSim.Framework return "application/vnd.ll.outfitfolder"; case AssetType.MyOutfitsFolder: return "application/vnd.ll.myoutfitsfolder"; - case AssetType.InboxFolder: - return "application/vnd.ll.inboxfolder"; case AssetType.Unknown: default: return "application/octet-stream"; @@ -128,7 +126,7 @@ namespace OpenSim.Framework case InventoryType.Object: return "application/vnd.ll.primitive"; case InventoryType.Sound: - return "application/ogg"; + return "audio/ogg"; case InventoryType.Snapshot: case InventoryType.Texture: return "image/x-j2c"; @@ -147,6 +145,7 @@ namespace OpenSim.Framework case "image/jp2": return (sbyte)AssetType.Texture; case "application/ogg": + case "audio/ogg": return (sbyte)AssetType.Sound; case "application/vnd.ll.callingcard": case "application/x-metaverse-callingcard": @@ -209,8 +208,6 @@ namespace OpenSim.Framework return (sbyte)AssetType.OutfitFolder; case "application/vnd.ll.myoutfitsfolder": return (sbyte)AssetType.MyOutfitsFolder; - case "application/vnd.ll.inboxfolder": - return (sbyte)AssetType.InboxFolder; case "application/octet-stream": default: return (sbyte)AssetType.Unknown; @@ -227,6 +224,7 @@ namespace OpenSim.Framework case "image/jpeg": return (sbyte)InventoryType.Texture; case "application/ogg": + case "audio/ogg": case "audio/x-wav": return (sbyte)InventoryType.Sound; case "application/vnd.ll.callingcard": -- cgit v1.1 From a7f4e10f425cef4b85810486ba31c59b3ba206fc Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 10 Sep 2010 21:50:40 +0100 Subject: Remove parenthesis around the release flavour to get the version string back under 27 chars Can't quite remember why this has to be <=27 chars, maybe something to do with the space available for the version string in a typical client --- OpenSim/Framework/Servers/VersionInfo.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Servers/VersionInfo.cs b/OpenSim/Framework/Servers/VersionInfo.cs index 100bf1f..c88e0d1 100644 --- a/OpenSim/Framework/Servers/VersionInfo.cs +++ b/OpenSim/Framework/Servers/VersionInfo.cs @@ -49,7 +49,7 @@ namespace OpenSim public static string GetVersionString(string versionNumber, Flavour flavour) { - string versionString = "OpenSim " + versionNumber + " (" + flavour + ")"; + string versionString = "OpenSim " + versionNumber + " " + flavour; return versionString.PadRight(VERSIONINFO_VERSION_LENGTH); } -- cgit v1.1 From 30306a775af74e1fe080590998a71a4c7e64ad12 Mon Sep 17 00:00:00 2001 From: randomhuman Date: Sun, 5 Sep 2010 21:44:46 +0100 Subject: Made it impossible to create a user with names containing spaces and prevented passwords from being echoed after enter is pressed. --- OpenSim/Framework/Console/ConsoleBase.cs | 51 +++++++++++++++++++++++++++++++ OpenSim/Framework/Console/LocalConsole.cs | 5 +-- 2 files changed, 54 insertions(+), 2 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Console/ConsoleBase.cs b/OpenSim/Framework/Console/ConsoleBase.cs index aab920b..22ce880 100755 --- a/OpenSim/Framework/Console/ConsoleBase.cs +++ b/OpenSim/Framework/Console/ConsoleBase.cs @@ -89,6 +89,57 @@ namespace OpenSim.Framework.Console return ret; } + + public string CmdPrompt(string p, List excludedCharacters) + { + bool itisdone = false; + string ret = String.Empty; + while (!itisdone) + { + itisdone = true; + ret = CmdPrompt(p); + + foreach (char c in excludedCharacters) + { + if (ret.Contains(c.ToString())) + { + System.Console.WriteLine("The character \"" + c.ToString() + "\" is not permitted."); + itisdone = false; + } + } + } + + return ret; + } + + public string CmdPrompt(string p, string def, List excludedCharacters) + { + bool itisdone = false; + string ret = String.Empty; + while (!itisdone) + { + itisdone = true; + ret = CmdPrompt(p, def); + + if (ret == String.Empty) + { + ret = def; + } + else + { + foreach (char c in excludedCharacters) + { + if (ret.Contains(c.ToString())) + { + System.Console.WriteLine("The character \"" + c.ToString() + "\" is not permitted."); + itisdone = false; + } + } + } + } + + return ret; + } // Displays a command prompt and returns a default value, user may only enter 1 of 2 options public string CmdPrompt(string prompt, string defaultresponse, List options) diff --git a/OpenSim/Framework/Console/LocalConsole.cs b/OpenSim/Framework/Console/LocalConsole.cs index a3036d0..c968031 100644 --- a/OpenSim/Framework/Console/LocalConsole.cs +++ b/OpenSim/Framework/Console/LocalConsole.cs @@ -461,7 +461,8 @@ namespace OpenSim.Framework.Console SetCursorLeft(0); y = SetCursorTop(y); - System.Console.WriteLine("{0}{1}", prompt, cmdline); + System.Console.WriteLine(); + //Show(); lock (cmdline) { @@ -486,7 +487,7 @@ namespace OpenSim.Framework.Console } } - AddToHistory(cmdline.ToString()); + //AddToHistory(cmdline.ToString()); return cmdline.ToString(); default: break; -- cgit v1.1 From 20cd1da6bf6118352af1f1f206bcd2303f098d6d Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Sun, 12 Sep 2010 12:54:31 -0400 Subject: Add copyright headers. --- OpenSim/Framework/Console/MockConsole.cs | 29 ++++++++++++++++++++++++++++- OpenSim/Framework/Lazy.cs | 2 +- 2 files changed, 29 insertions(+), 2 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Console/MockConsole.cs b/OpenSim/Framework/Console/MockConsole.cs index 9eb1977..a29b370 100644 --- a/OpenSim/Framework/Console/MockConsole.cs +++ b/OpenSim/Framework/Console/MockConsole.cs @@ -1,4 +1,31 @@ -using System; +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; using System.Threading; using System.Collections.Generic; using System.Text; diff --git a/OpenSim/Framework/Lazy.cs b/OpenSim/Framework/Lazy.cs index 8a417ac..91de4bd 100644 --- a/OpenSim/Framework/Lazy.cs +++ b/OpenSim/Framework/Lazy.cs @@ -1,4 +1,4 @@ -// +// // Lazy.cs // // Authors: -- cgit v1.1 From f1f0bc23f4501ba99035283d3407ddad2b21b785 Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Sun, 12 Sep 2010 13:43:49 -0400 Subject: Formatting cleanup. --- OpenSim/Framework/Capabilities/Caps.cs | 2 +- OpenSim/Framework/Console/CommandConsole.cs | 2 +- OpenSim/Framework/Console/LocalConsole.cs | 18 +-- OpenSim/Framework/LandData.cs | 28 ++--- OpenSim/Framework/LandUpdateArgs.cs | 14 +-- OpenSim/Framework/PrimitiveBaseShape.cs | 74 ++++++------- OpenSim/Framework/RegionInfo.cs | 28 ++--- .../Framework/Serialization/ArchiveConstants.cs | 20 ++-- .../Framework/Servers/HttpServer/BaseHttpServer.cs | 121 ++++++++++----------- 9 files changed, 152 insertions(+), 155 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Capabilities/Caps.cs b/OpenSim/Framework/Capabilities/Caps.cs index 8a339fe..6f32adf 100644 --- a/OpenSim/Framework/Capabilities/Caps.cs +++ b/OpenSim/Framework/Capabilities/Caps.cs @@ -760,7 +760,7 @@ namespace OpenSim.Framework.Capabilities string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000"); BakedTextureUploader uploader = - new BakedTextureUploader( capsBase + uploaderPath, + new BakedTextureUploader(capsBase + uploaderPath, m_httpListener); uploader.OnUpLoad += BakedTextureUploaded; diff --git a/OpenSim/Framework/Console/CommandConsole.cs b/OpenSim/Framework/Console/CommandConsole.cs index b17dbc0..52bcd55 100644 --- a/OpenSim/Framework/Console/CommandConsole.cs +++ b/OpenSim/Framework/Console/CommandConsole.cs @@ -151,7 +151,7 @@ namespace OpenSim.Framework.Console help.Add(commandInfo.descriptive_help); if (descriptiveHelp != string.Empty) - help.Add(string.Empty); + help.Add(string.Empty); } else { diff --git a/OpenSim/Framework/Console/LocalConsole.cs b/OpenSim/Framework/Console/LocalConsole.cs index c968031..6043094 100644 --- a/OpenSim/Framework/Console/LocalConsole.cs +++ b/OpenSim/Framework/Console/LocalConsole.cs @@ -38,7 +38,7 @@ namespace OpenSim.Framework.Console { /// /// A console that uses cursor control and color - /// + /// public class LocalConsole : CommandConsole { // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -100,8 +100,8 @@ namespace OpenSim.Framework.Console private int SetCursorTop(int top) { // From at least mono 2.4.2.3, window resizing can give mono an invalid row and column values. If we try - // to set a cursor row position with a currently invalid column, mono will throw an exception. - // Therefore, we need to make sure that the column position is valid first. + // to set a cursor row position with a currently invalid column, mono will throw an exception. + // Therefore, we need to make sure that the column position is valid first. int left = System.Console.CursorLeft; if (left < 0) @@ -121,7 +121,7 @@ namespace OpenSim.Framework.Console { top = 0; } - else + else { int bh = System.Console.BufferHeight; @@ -133,7 +133,7 @@ namespace OpenSim.Framework.Console System.Console.CursorTop = top; return top; - } + } /// /// Set the cursor column. @@ -145,12 +145,12 @@ namespace OpenSim.Framework.Console /// /// /// The new cursor column. - /// + /// private int SetCursorLeft(int left) { // From at least mono 2.4.2.3, window resizing can give mono an invalid row and column values. If we try - // to set a cursor column position with a currently invalid row, mono will throw an exception. - // Therefore, we need to make sure that the row position is valid first. + // to set a cursor column position with a currently invalid row, mono will throw an exception. + // Therefore, we need to make sure that the row position is valid first. int top = System.Console.CursorTop; if (top < 0) @@ -214,7 +214,7 @@ namespace OpenSim.Framework.Console System.Console.Write("{0}", prompt); SetCursorTop(new_y); - SetCursorLeft(new_x); + SetCursorLeft(new_x); } } diff --git a/OpenSim/Framework/LandData.cs b/OpenSim/Framework/LandData.cs index 8d3266b..accf52e 100644 --- a/OpenSim/Framework/LandData.cs +++ b/OpenSim/Framework/LandData.cs @@ -89,13 +89,13 @@ namespace OpenSim.Framework private Vector3 _userLocation = new Vector3(); private Vector3 _userLookAt = new Vector3(); private int _otherCleanTime = 0; - private string _mediaType = "none/none"; - private string _mediaDescription = ""; - private int _mediaHeight = 0; - private int _mediaWidth = 0; - private bool _mediaLoop = false; - private bool _obscureMusic = false; - private bool _obscureMedia = false; + private string _mediaType = "none/none"; + private string _mediaDescription = ""; + private int _mediaHeight = 0; + private int _mediaWidth = 0; + private bool _mediaLoop = false; + private bool _obscureMusic = false; + private bool _obscureMedia = false; /// /// Whether to obscure parcel media URL @@ -690,13 +690,13 @@ namespace OpenSim.Framework landData._userLocation = _userLocation; landData._userLookAt = _userLookAt; landData._otherCleanTime = _otherCleanTime; - landData._mediaType = _mediaType; - landData._mediaDescription = _mediaDescription; - landData._mediaWidth = _mediaWidth; - landData._mediaHeight = _mediaHeight; - landData._mediaLoop = _mediaLoop; - landData._obscureMusic = _obscureMusic; - landData._obscureMedia = _obscureMedia; + landData._mediaType = _mediaType; + landData._mediaDescription = _mediaDescription; + landData._mediaWidth = _mediaWidth; + landData._mediaHeight = _mediaHeight; + landData._mediaLoop = _mediaLoop; + landData._obscureMusic = _obscureMusic; + landData._obscureMedia = _obscureMedia; landData._parcelAccessList.Clear(); foreach (ParcelManager.ParcelAccessEntry entry in _parcelAccessList) diff --git a/OpenSim/Framework/LandUpdateArgs.cs b/OpenSim/Framework/LandUpdateArgs.cs index ed496a1..7d6c4f2 100644 --- a/OpenSim/Framework/LandUpdateArgs.cs +++ b/OpenSim/Framework/LandUpdateArgs.cs @@ -49,12 +49,12 @@ namespace OpenSim.Framework public UUID SnapshotID; public Vector3 UserLocation; public Vector3 UserLookAt; - public string MediaType; - public string MediaDescription; - public int MediaHeight; - public int MediaWidth; - public bool MediaLoop; - public bool ObscureMusic; - public bool ObscureMedia; + public string MediaType; + public string MediaDescription; + public int MediaHeight; + public int MediaWidth; + public bool MediaLoop; + public bool ObscureMusic; + public bool ObscureMedia; } } diff --git a/OpenSim/Framework/PrimitiveBaseShape.cs b/OpenSim/Framework/PrimitiveBaseShape.cs index 70a61cc..0a81363 100644 --- a/OpenSim/Framework/PrimitiveBaseShape.cs +++ b/OpenSim/Framework/PrimitiveBaseShape.cs @@ -175,7 +175,7 @@ namespace OpenSim.Framework } } } - + /// /// Entries to store media textures on each face /// @@ -1216,28 +1216,28 @@ namespace OpenSim.Framework prim.Properties.Permissions = new Permissions(); prim.Properties.SalePrice = 10; prim.Properties.SaleType = new SaleType(); - + return prim; } - + /// /// Encapsulates a list of media entries. /// - /// This class is necessary because we want to replace auto-serialization of MediaEntry with something more + /// This class is necessary because we want to replace auto-serialization of MediaEntry with something more /// OSD like and less vulnerable to change. public class MediaList : List, IXmlSerializable - { + { public const string MEDIA_TEXTURE_TYPE = "sl"; - + public MediaList() : base() {} public MediaList(IEnumerable collection) : base(collection) {} public MediaList(int capacity) : base(capacity) {} - + public XmlSchema GetSchema() { return null; } - + public string ToXml() { lock (this) @@ -1245,78 +1245,78 @@ namespace OpenSim.Framework using (StringWriter sw = new StringWriter()) { using (XmlTextWriter xtw = new XmlTextWriter(sw)) - { + { xtw.WriteStartElement("OSMedia"); xtw.WriteAttributeString("type", MEDIA_TEXTURE_TYPE); xtw.WriteAttributeString("version", "0.1"); - + OSDArray meArray = new OSDArray(); foreach (MediaEntry me in this) { OSD osd = (null == me ? new OSD() : me.GetOSD()); meArray.Add(osd); - } - + } + xtw.WriteStartElement("OSData"); xtw.WriteRaw(OSDParser.SerializeLLSDXmlString(meArray)); xtw.WriteEndElement(); - + xtw.WriteEndElement(); - - xtw.Flush(); + + xtw.Flush(); return sw.ToString(); } - } - } + } + } } - + public void WriteXml(XmlWriter writer) - { + { writer.WriteRaw(ToXml()); } - + public static MediaList FromXml(string rawXml) { MediaList ml = new MediaList(); ml.ReadXml(rawXml); return ml; } - + public void ReadXml(string rawXml) - { + { using (StringReader sr = new StringReader(rawXml)) { using (XmlTextReader xtr = new XmlTextReader(sr)) - { + { xtr.MoveToContent(); - + string type = xtr.GetAttribute("type"); //m_log.DebugFormat("[MOAP]: Loaded media texture entry with type {0}", type); - + if (type != MEDIA_TEXTURE_TYPE) - return; - - xtr.ReadStartElement("OSMedia"); - + return; + + xtr.ReadStartElement("OSMedia"); + OSDArray osdMeArray = (OSDArray)OSDParser.DeserializeLLSDXml(xtr.ReadInnerXml()); foreach (OSD osdMe in osdMeArray) { MediaEntry me = (osdMe is OSDMap ? MediaEntry.FromOSD(osdMe) : new MediaEntry()); Add(me); } - - xtr.ReadEndElement(); + + xtr.ReadEndElement(); } } - } - + } + public void ReadXml(XmlReader reader) { if (reader.IsEmptyElement) return; - + ReadXml(reader.ReadInnerXml()); - } + } } - } -} \ No newline at end of file + } +} diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs index 12c58c3..08d5398 100644 --- a/OpenSim/Framework/RegionInfo.cs +++ b/OpenSim/Framework/RegionInfo.cs @@ -97,9 +97,9 @@ namespace OpenSim.Framework [Serializable] public class SimpleRegionInfo - { + { // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + /// /// The port by which http communication occurs with the region (most noticeably, CAPS communication) /// @@ -344,7 +344,7 @@ namespace OpenSim.Framework public string proxyUrl = ""; public int ProxyOffset = 0; public string regionSecret = UUID.Random().ToString(); - + public string osSecret; public UUID lastMapUUID = UUID.Zero; @@ -699,7 +699,7 @@ namespace OpenSim.Framework RegionID = new UUID(regionUUID); originRegionID = RegionID; // What IS this?! - + RegionName = name; string location = config.GetString("Location", String.Empty); @@ -720,7 +720,7 @@ namespace OpenSim.Framework // Internal IP IPAddress address; - + if (config.Contains("InternalAddress")) { address = IPAddress.Parse(config.GetString("InternalAddress", String.Empty)); @@ -774,7 +774,7 @@ namespace OpenSim.Framework { m_externalHostName = Util.GetLocalHost().ToString(); m_log.InfoFormat( - "[REGIONINFO]: Resolving SYSTEMIP to {0} for external hostname of region {1}", + "[REGIONINFO]: Resolving SYSTEMIP to {0} for external hostname of region {1}", m_externalHostName, name); } else @@ -909,16 +909,16 @@ namespace OpenSim.Framework configMember.addConfigurationOption("nonphysical_prim_max", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "Maximum size for nonphysical prims", m_nonphysPrimMax.ToString(), true); - + configMember.addConfigurationOption("physical_prim_max", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "Maximum size for physical prims", m_physPrimMax.ToString(), true); - + configMember.addConfigurationOption("clamp_prim_size", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN, "Clamp prims to max size", m_clampPrimSize.ToString(), true); - + configMember.addConfigurationOption("object_capacity", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "Max objects this sim will hold", m_objectCapacity.ToString(), true); - + configMember.addConfigurationOption("scope_id", ConfigurationOption.ConfigurationTypes.TYPE_UUID, "Scope ID for this region", ScopeID.ToString(), true); @@ -956,16 +956,16 @@ namespace OpenSim.Framework configMember.addConfigurationOption("lastmap_refresh", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Last Map Refresh", Util.UnixTimeSinceEpoch().ToString(), true); - + configMember.addConfigurationOption("nonphysical_prim_max", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "Maximum size for nonphysical prims", "0", true); - + configMember.addConfigurationOption("physical_prim_max", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "Maximum size for physical prims", "0", true); - + configMember.addConfigurationOption("clamp_prim_size", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN, "Clamp prims to max size", "false", true); - + configMember.addConfigurationOption("object_capacity", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "Max objects this sim will hold", "0", true); diff --git a/OpenSim/Framework/Serialization/ArchiveConstants.cs b/OpenSim/Framework/Serialization/ArchiveConstants.cs index 3143e3b..7a9b33d 100644 --- a/OpenSim/Framework/Serialization/ArchiveConstants.cs +++ b/OpenSim/Framework/Serialization/ArchiveConstants.cs @@ -157,9 +157,9 @@ namespace OpenSim.Framework.Serialization public static string CreateOarObjectFilename(string objectName, UUID uuid, Vector3 pos) { return string.Format( - OAR_OBJECT_FILENAME_TEMPLATE, objectName, + OAR_OBJECT_FILENAME_TEMPLATE, objectName, Math.Round(pos.X), Math.Round(pos.Y), Math.Round(pos.Z), - uuid); + uuid); } /// @@ -171,9 +171,9 @@ namespace OpenSim.Framework.Serialization /// public static string CreateOarObjectPath(string objectName, UUID uuid, Vector3 pos) { - return OBJECTS_PATH + CreateOarObjectFilename(objectName, uuid, pos); - } - + return OBJECTS_PATH + CreateOarObjectFilename(objectName, uuid, pos); + } + /// /// Extract a plain path from an IAR path /// @@ -184,18 +184,18 @@ namespace OpenSim.Framework.Serialization List plainDirs = new List(); string[] iarDirs = iarPath.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries); - + foreach (string iarDir in iarDirs) { if (!iarDir.Contains(ArchiveConstants.INVENTORY_NODE_NAME_COMPONENT_SEPARATOR)) plainDirs.Add(iarDir); - + int i = iarDir.LastIndexOf(ArchiveConstants.INVENTORY_NODE_NAME_COMPONENT_SEPARATOR); plainDirs.Add(iarDir.Remove(i)); } - - return string.Join("/", plainDirs.ToArray()); + + return string.Join("/", plainDirs.ToArray()); } } -} \ No newline at end of file +} diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index d20f8c9..452df38 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs @@ -51,7 +51,7 @@ namespace OpenSim.Framework.Servers.HttpServer { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private HttpServerLogWriter httpserverlog = new HttpServerLogWriter(); - + private volatile int NotSocketErrors = 0; public volatile bool HTTPDRunning = false; @@ -160,7 +160,7 @@ namespace OpenSim.Framework.Servers.HttpServer m_rpcHandlers[method] = handler; m_rpcHandlersKeepAlive[method] = keepAlive; // default } - + return true; } @@ -182,7 +182,7 @@ namespace OpenSim.Framework.Servers.HttpServer public bool AddHTTPHandler(string methodName, GenericHTTPMethod handler) { //m_log.DebugFormat("[BASE HTTP SERVER]: Registering {0}", methodName); - + lock (m_HTTPHandlers) { if (!m_HTTPHandlers.ContainsKey(methodName)) @@ -204,14 +204,14 @@ namespace OpenSim.Framework.Servers.HttpServer if (!m_pollHandlers.ContainsKey(methodName)) { m_pollHandlers.Add(methodName,args); - pollHandlerResult = true; + pollHandlerResult = true; } } - + if (pollHandlerResult) return AddHTTPHandler(methodName, handler); - return false; + return false; } // Note that the agent string is provided simply to differentiate @@ -257,51 +257,51 @@ namespace OpenSim.Framework.Servers.HttpServer { IHttpClientContext context = (IHttpClientContext)source; IHttpRequest request = args.Request; - + PollServiceEventArgs psEvArgs; - + if (TryGetPollServiceHTTPHandler(request.UriPath.ToString(), out psEvArgs)) { PollServiceHttpRequest psreq = new PollServiceHttpRequest(psEvArgs, context, request); - + if (psEvArgs.Request != null) { OSHttpRequest req = new OSHttpRequest(context, request); - + Stream requestStream = req.InputStream; - + Encoding encoding = Encoding.UTF8; StreamReader reader = new StreamReader(requestStream, encoding); - + string requestBody = reader.ReadToEnd(); - + Hashtable keysvals = new Hashtable(); Hashtable headervals = new Hashtable(); - + string[] querystringkeys = req.QueryString.AllKeys; string[] rHeaders = req.Headers.AllKeys; - + keysvals.Add("body", requestBody); keysvals.Add("uri", req.RawUrl); keysvals.Add("content-type", req.ContentType); keysvals.Add("http-method", req.HttpMethod); - + foreach (string queryname in querystringkeys) { keysvals.Add(queryname, req.QueryString[queryname]); } - + foreach (string headername in rHeaders) { headervals[headername] = req.Headers[headername]; } - + keysvals.Add("headers", headervals); keysvals.Add("querystringkeys", querystringkeys); - + psEvArgs.Request(psreq.RequestID, keysvals); } - + m_PollServiceManager.Enqueue(psreq); } else @@ -348,10 +348,10 @@ namespace OpenSim.Framework.Servers.HttpServer { try { -// m_log.Debug("[BASE HTTP SERVER]: Handling request to " + request.RawUrl); - +// m_log.Debug("[BASE HTTP SERVER]: Handling request to " + request.RawUrl); + Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US", true); - + // This is the REST agent interface. We require an agent to properly identify // itself. If the REST handler recognizes the prefix it will attempt to // satisfy the request. If it is not recognizable, and no damage has occurred @@ -456,7 +456,7 @@ namespace OpenSim.Framework.Servers.HttpServer } request.InputStream.Close(); - + // HTTP IN support. The script engine taes it from here // Nothing to worry about for us. // @@ -540,7 +540,7 @@ namespace OpenSim.Framework.Servers.HttpServer HandleLLSDRequests(request, response); return; } - + // m_log.DebugFormat("[BASE HTTP SERVER]: Checking for HTTP Handler for request {0}", request.RawUrl); if (DoWeHaveAHTTPHandler(request.RawUrl)) { @@ -594,7 +594,7 @@ namespace OpenSim.Framework.Servers.HttpServer } } } - + if (String.IsNullOrEmpty(bestMatch)) { streamHandler = null; @@ -641,7 +641,7 @@ namespace OpenSim.Framework.Servers.HttpServer private bool TryGetHTTPHandler(string handlerKey, out GenericHTTPMethod HTTPHandler) { // m_log.DebugFormat("[BASE HTTP HANDLER]: Looking for HTTP handler for {0}", handlerKey); - + string bestMatch = null; lock (m_HTTPHandlers) @@ -727,14 +727,14 @@ namespace OpenSim.Framework.Servers.HttpServer { xmlRprcRequest.Params.Add(request.RemoteIPEndPoint); // Param[1] XmlRpcResponse xmlRpcResponse; - + XmlRpcMethod method; bool methodWasFound; lock (m_rpcHandlers) { methodWasFound = m_rpcHandlers.TryGetValue(methodName, out method); } - + if (methodWasFound) { xmlRprcRequest.Params.Add(request.Url); // Param[2] @@ -766,10 +766,10 @@ namespace OpenSim.Framework.Servers.HttpServer else { xmlRpcResponse = new XmlRpcResponse(); - + // Code set in accordance with http://xmlrpc-epi.sourceforge.net/specs/rfc.fault_codes.php xmlRpcResponse.SetFault( - XmlRpcErrorCodes.SERVER_ERROR_METHOD, + XmlRpcErrorCodes.SERVER_ERROR_METHOD, String.Format("Requested method [{0}] not found", methodName)); } @@ -786,11 +786,11 @@ namespace OpenSim.Framework.Servers.HttpServer response.KeepAlive = false; m_log.ErrorFormat("[BASE HTTP SERVER]: Handler not found for http request {0}", request.RawUrl); - + response.SendChunked = false; response.ContentLength64 = buf.Length; response.ContentEncoding = Encoding.UTF8; - + try { response.OutputStream.Write(buf, 0, buf.Length); @@ -872,13 +872,13 @@ namespace OpenSim.Framework.Servers.HttpServer OSD llsdRequest = null; OSD llsdResponse = null; - + bool LegacyLLSDLoginLibOMV = (requestBody.Contains("passwd") && requestBody.Contains("mac") && requestBody.Contains("viewer_digest")); - + if (requestBody.Length == 0) // Get Request { - requestBody = "requestget"; + requestBody = "requestget"; } try { @@ -1090,7 +1090,7 @@ namespace OpenSim.Framework.Servers.HttpServer string bestMatch = null; //m_log.DebugFormat("[BASE HTTP HANDLER]: Checking if we have an HTTP handler for {0}", searchquery); - + lock (m_HTTPHandlers) { foreach (string pattern in m_HTTPHandlers.Keys) @@ -1156,7 +1156,7 @@ namespace OpenSim.Framework.Servers.HttpServer // You have to specifically register for '/' and to get it, you must specificaly request it // if (pattern == "/" && searchquery == "/" || pattern != "/") - bestMatch = pattern; + bestMatch = pattern; } } } @@ -1236,11 +1236,11 @@ namespace OpenSim.Framework.Servers.HttpServer } public void HandleHTTPRequest(OSHttpRequest request, OSHttpResponse response) - { + { // m_log.DebugFormat( -// "[BASE HTTP SERVER]: HandleHTTPRequest for request to {0}, method {1}", +// "[BASE HTTP SERVER]: HandleHTTPRequest for request to {0}, method {1}", // request.RawUrl, request.HttpMethod); - + switch (request.HttpMethod) { case "OPTIONS": @@ -1256,7 +1256,7 @@ namespace OpenSim.Framework.Servers.HttpServer private void HandleContentVerbs(OSHttpRequest request, OSHttpResponse response) { // m_log.DebugFormat("[BASE HTTP SERVER]: HandleContentVerbs for request to {0}", request.RawUrl); - + // This is a test. There's a workable alternative.. as this way sucks. // We'd like to put this into a text file parhaps that's easily editable. // @@ -1391,7 +1391,7 @@ namespace OpenSim.Framework.Servers.HttpServer // m_log.DebugFormat( // "[BASE HTTP HANDLER]: TryGetHTTPHandlerPathBased() looking for HTTP handler to match {0}", searchquery); - + lock (m_HTTPHandlers) { foreach (string pattern in m_HTTPHandlers.Keys) @@ -1452,7 +1452,7 @@ namespace OpenSim.Framework.Servers.HttpServer //Even though only one other part of the entire code uses HTTPHandlers, we shouldn't expect this //and should check for NullReferenceExceptions - + if (string.IsNullOrEmpty(contentType)) { contentType = "text/html"; @@ -1472,8 +1472,8 @@ namespace OpenSim.Framework.Servers.HttpServer byte[] buffer; - if (!(contentType.Contains("image") - || contentType.Contains("x-shockwave-flash") + if (!(contentType.Contains("image") + || contentType.Contains("x-shockwave-flash") || contentType.Contains("application/x-oar"))) { // Text @@ -1504,7 +1504,7 @@ namespace OpenSim.Framework.Servers.HttpServer { response.OutputStream.Flush(); response.Send(); - + //if (!response.KeepAlive && response.ReuseContext) // response.FreeContext(); } @@ -1611,11 +1611,11 @@ namespace OpenSim.Framework.Servers.HttpServer m_httpListener2 = CoolHTTPListener.Create(m_listenIPAddress, (int)m_port); m_httpListener2.ExceptionThrown += httpServerException; m_httpListener2.LogWriter = httpserverlog; - - // Uncomment this line in addition to those in HttpServerLogWriter + + // Uncomment this line in addition to those in HttpServerLogWriter // if you want more detailed trace information from the HttpServer //m_httpListener2.UseTraceLogs = true; - + //m_httpListener2.DisconnectHandler = httpServerDisconnectMonitor; } else @@ -1643,8 +1643,8 @@ namespace OpenSim.Framework.Servers.HttpServer { m_log.Error("[BASE HTTP SERVER]: Error - " + e.Message); m_log.Error("[BASE HTTP SERVER]: Tip: Do you have permission to listen on port " + m_port + ", " + m_sslport + "?"); - - // We want this exception to halt the entire server since in current configurations we aren't too + + // We want this exception to halt the entire server since in current configurations we aren't too // useful without inbound HTTP. throw e; } @@ -1656,7 +1656,7 @@ namespace OpenSim.Framework.Servers.HttpServer { case SocketError.NotSocket: NotSocketErrors++; - + break; } } @@ -1686,12 +1686,11 @@ namespace OpenSim.Framework.Servers.HttpServer m_httpListener2.LogWriter = null; m_httpListener2.RequestReceived -= OnRequest; m_httpListener2.Stop(); - } + } catch (NullReferenceException) { m_log.Warn("[BASE HTTP SERVER]: Null Reference when stopping HttpServer."); } - } public void RemoveStreamHandler(string httpMethod, string path) @@ -1712,7 +1711,7 @@ namespace OpenSim.Framework.Servers.HttpServer m_HTTPHandlers.Remove(path); return; } - + m_HTTPHandlers.Remove(GetHandlerKey(httpMethod, path)); } } @@ -1728,7 +1727,6 @@ namespace OpenSim.Framework.Servers.HttpServer } RemoveHTTPHandler(httpMethod, path); - } public bool RemoveAgentHandler(string agent, IHttpAgentHandler handler) @@ -1759,7 +1757,6 @@ namespace OpenSim.Framework.Servers.HttpServer } } - public bool RemoveLLSDHandler(string path, LLSDMethod handler) { try @@ -1833,7 +1830,7 @@ namespace OpenSim.Framework.Servers.HttpServer oresp = osresp; } } - + /// /// Relays HttpServer log messages to our own logging mechanism. /// @@ -1852,7 +1849,7 @@ namespace OpenSim.Framework.Servers.HttpServer { case LogPrio.Trace: m_log.DebugFormat("[{0}]: {1}", source, message); - break; + break; case LogPrio.Debug: m_log.DebugFormat("[{0}]: {1}", source, message); break; @@ -1872,8 +1869,8 @@ namespace OpenSim.Framework.Servers.HttpServer break; } */ - + return; } } -} \ No newline at end of file +} -- cgit v1.1 From 0db1ed0b5a6f5bd104c6008f142d173c84263ce5 Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Sun, 12 Sep 2010 14:20:26 -0700 Subject: * Added ISimulationDataService and IEstateDataService * Removed StorageManager * CONFIG CHANGE: There are no more database settings in OpenSim.ini. Check the config-include configuration files for region store and estate store database settings --- OpenSim/Framework/ConfigSettings.cs | 16 ---------------- 1 file changed, 16 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/ConfigSettings.cs b/OpenSim/Framework/ConfigSettings.cs index 8feaa37..be77341 100644 --- a/OpenSim/Framework/ConfigSettings.cs +++ b/OpenSim/Framework/ConfigSettings.cs @@ -124,22 +124,6 @@ namespace OpenSim.Framework set { m_standaloneUserSource = value; } } - protected string m_storageConnectionString; - - public string StorageConnectionString - { - get { return m_storageConnectionString; } - set { m_storageConnectionString = value; } - } - - protected string m_estateConnectionString; - - public string EstateConnectionString - { - get { return m_estateConnectionString; } - set { m_estateConnectionString = value; } - } - protected string m_librariesXMLFile; public string LibrariesXMLFile { -- cgit v1.1