diff --git a/OpenSim/Data/PGSQL/PGSQLSimulationData.cs b/OpenSim/Data/PGSQL/PGSQLSimulationData.cs index bea9cc0315..1d2fd35d4a 100755 --- a/OpenSim/Data/PGSQL/PGSQLSimulationData.cs +++ b/OpenSim/Data/PGSQL/PGSQLSimulationData.cs @@ -1831,12 +1831,12 @@ namespace OpenSim.Data.PGSQL if (prim.VehicleParams != null) parameters.Add(_Database.CreateParameter("Vehicle", prim.VehicleParams.ToXml2())); else - parameters.Add(_Database.CreateParameter("Vehicle", String.Empty)); + parameters.Add(_Database.CreateParameter("Vehicle", string.Empty)); if (prim.PhysicsInertia != null) parameters.Add(_Database.CreateParameter("PhysInertia", prim.PhysicsInertia.ToXml2())); else - parameters.Add(_Database.CreateParameter("PhysInertia", String.Empty)); + parameters.Add(_Database.CreateParameter("PhysInertia", string.Empty)); if (prim.DynAttrs != null && prim.DynAttrs.CountNamespaces > 0) parameters.Add(_Database.CreateParameter("DynAttrs", prim.DynAttrs.ToXml())); diff --git a/OpenSim/Framework/Servers/HttpServer/Interfaces/IHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/Interfaces/IHttpServer.cs index 572fb85cc6..c4bc5ff234 100644 --- a/OpenSim/Framework/Servers/HttpServer/Interfaces/IHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/Interfaces/IHttpServer.cs @@ -47,29 +47,6 @@ namespace OpenSim.Framework.Servers.HttpServer // bool AddAgentHandler(string agent, IHttpAgentHandler handler); /// - /// Add a handler for an HTTP request. - /// - /// - /// This handler can actually be invoked either as - /// - /// http://:/?method= - /// - /// or - /// - /// http://: - /// - /// if the method name starts with a slash. For example, AddHTTPHandler("/object/", ...) on a standalone region - /// server will register a handler that can be invoked with either - /// - /// http://localhost:9000/?method=/object/ - /// - /// or - /// - /// http://localhost:9000/object/ - /// - /// In addition, the handler invoked by the HTTP server for any request is the one when best matches the request - /// URI. So if a handler for "/myapp/" is registered and a request for "/myapp/page" is received, then - /// the "/myapp/" handler is invoked if no "/myapp/page" handler exists. /// /// /// diff --git a/OpenSim/Framework/Servers/HttpServer/SimpleStreamHandler.cs b/OpenSim/Framework/Servers/HttpServer/SimpleStreamHandler.cs index 6badb7b424..cf32ce6158 100644 --- a/OpenSim/Framework/Servers/HttpServer/SimpleStreamHandler.cs +++ b/OpenSim/Framework/Servers/HttpServer/SimpleStreamHandler.cs @@ -25,7 +25,6 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -using System.IO; using System.Net; using OpenSim.Framework.ServiceAuth; diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 78cd741012..4228609965 100755 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -6267,10 +6267,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP zc.AddUUID(sop.LastOwnerID); //name - zc.AddShortString(sop.Name, 64); + zc.AddShortLimitedUTF8(sop.osUTF8Name); //Description - zc.AddShortString(sop.Description, 128); + zc.AddShortLimitedUTF8(sop.osUTF8Description); } private void CreateObjectPropertiesBlock(SceneObjectPart sop, LLUDPZeroEncoder zc) @@ -6317,7 +6317,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP zc.AddShortLimitedUTF8(sop.osUTF8Name); //Description - zc.AddShortLimitedUTF8(sop.osUTF8description); + zc.AddShortLimitedUTF8(sop.osUTF8Description); // touch name zc.AddShortLimitedUTF8(sop.osUTF8TouchName); @@ -7333,11 +7333,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP } //text - if (part.Text == null || part.Text.Length == 0) + osUTF8 osUTF8PartText = part.osUTF8Text; + if (osUTF8PartText == null || osUTF8PartText.Length == 0) zc.AddZeros(5); else { - zc.AddShortString(part.Text, 255); + zc.AddShortLimitedUTF8(osUTF8PartText); //textcolor byte[] tc = part.GetTextColor().GetBytes(false); @@ -7756,13 +7757,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP else BlockLengh += extraParamBytes.Length; - byte[] hoverText = null; byte[] hoverTextColor = null; - if (part.Text != null && part.Text.Length > 0) + osUTF8 osUTF8PartText = part.osUTF8Text; + if (osUTF8PartText != null && osUTF8PartText.Length > 0) { cflags |= CompressedFlags.HasText; - hoverText = Util.StringToBytes256(part.Text); - BlockLengh += hoverText.Length; + BlockLengh += osUTF8PartText.Length + 1; hoverTextColor = part.GetTextColor().GetBytes(false); BlockLengh += hoverTextColor.Length; hastext = true; @@ -7811,9 +7811,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP hasangvel = true; } - if (part.osUTFMediaUrl.Length > 0) + osUTF8 osUTFMediaUrl = part.osUTFMediaUrl; + if (osUTFMediaUrl != null && osUTFMediaUrl.Length > 0) { - BlockLengh += part.osUTFMediaUrl.Length + 1; + BlockLengh += osUTFMediaUrl.Length + 1; cflags |= CompressedFlags.MediaURL; hasmediaurl = true; } @@ -7893,12 +7894,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP } if (hastext) { - zc.AddBytes(hoverText, hoverText.Length); + zc.AddBytes(osUTF8PartText.GetArray(), osUTF8PartText.Length); + zc.AddZeros(1); zc.AddBytes(hoverTextColor, hoverTextColor.Length); } if (hasmediaurl) { - zc.AddBytes(part.osUTFMediaUrl.GetArray(), part.osUTFMediaUrl.Length); + zc.AddBytes(osUTFMediaUrl.GetArray(), osUTFMediaUrl.Length); zc.AddZeros(1); } if (hasps) diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPZeroEncoder.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPZeroEncoder.cs index 1efc893a99..7315a7b7db 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPZeroEncoder.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPZeroEncoder.cs @@ -352,11 +352,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP AddBytes(data, len); } - // maxlen <= 255 and includes null termination byte, maxchars == max len of utf16 source + // maxlen <= 254 because null termination byte public unsafe void AddShortLimitedUTF8(osUTF8 str) { + if(str == null) + { + AddZeros(1); + return; + } + int len = str.Length; - if (str.Length == 0) + if (len == 0) { AddZeros(1); return; diff --git a/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs b/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs index 6797f34411..640329afae 100644 --- a/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs +++ b/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs @@ -333,7 +333,7 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap resp.PrimID = primId; resp.FaceMedia = currentML; - if (part.MediaUrl == null) + if (string.IsNullOrEmpty(part.MediaUrl)) resp.Version = "x-mv:0000000000/00000000-0000-0000-0000-000000000000"; else resp.Version = part.MediaUrl; @@ -570,7 +570,7 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap /// protected void UpdateMediaUrl(SceneObjectPart part, UUID updateId) { - if (null == part.MediaUrl) + if (string.IsNullOrEmpty(part.MediaUrl)) { // TODO: We can't set the last changer until we start tracking which cap we give to which agent id part.MediaUrl = "x-mv:0000000001/" + updateId; diff --git a/OpenSim/Region/Framework/Scenes/EntityBase.cs b/OpenSim/Region/Framework/Scenes/EntityBase.cs index c0ab7d08cc..da6ef77302 100644 --- a/OpenSim/Region/Framework/Scenes/EntityBase.cs +++ b/OpenSim/Region/Framework/Scenes/EntityBase.cs @@ -61,8 +61,8 @@ namespace OpenSim.Region.Framework.Scenes public osUTF8 osUTF8Name; public virtual string Name { - get { return osUTF8Name.ToString(); } - set { osUTF8Name = new osUTF8(value); } + get { return osUTF8Name == null ? string.Empty : osUTF8Name.ToString(); } + set { osUTF8Name = value == null? null : new osUTF8(value); } } /// diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index d5f7a6052b..e69ff4b0bb 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -350,11 +350,6 @@ namespace OpenSim.Region.Framework.Scenes protected bool m_isSelected = false; - /// - /// Stores media texture data - /// - protected string m_mediaUrl; - // TODO: Those have to be changed into persistent properties at some later point, // or sit-camera on vehicles will break on sim-crossing. private Vector3 m_cameraEyeOffset; @@ -627,18 +622,28 @@ namespace OpenSim.Region.Framework.Scenes { get { - return osUTF8LargeName.ToString(); + return osUTF8LargeName == null ? string.Empty : osUTF8LargeName.ToString(); } set { - osUTF8LargeName = new osUTF8(value); - osUTF8Name = new osUTF8(value, 63); - if(ParentGroup != null) + if(string.IsNullOrEmpty(value)) + { + osUTF8LargeName = null; + osUTF8Name = null; + PhysicsActor pa = PhysActor; + if (pa != null) + pa.SOPName = string.Empty; + } + else + { + osUTF8LargeName = new osUTF8(value); + osUTF8Name = new osUTF8(value, 63); + PhysicsActor pa = PhysActor; + if (pa != null) + pa.SOPName = value; + } + if (ParentGroup != null) ParentGroup.InvalidatePartsLinkMaps(); - - PhysicsActor pa = PhysActor; - if (pa != null) - pa.SOPName = value; } } @@ -1042,11 +1047,11 @@ namespace OpenSim.Region.Framework.Scenes } } - public osUTF8 osUTF8description; + public osUTF8 osUTF8Description; public string Description { - get {return osUTF8description.ToString(); } - set { osUTF8description = new osUTF8(value, 127);} + get {return osUTF8Description == null ? string.Empty : osUTF8Description.ToString(); } + set { osUTF8Description = string.IsNullOrEmpty(value) ? null : new osUTF8(value, 127);} } /// @@ -1061,22 +1066,22 @@ namespace OpenSim.Region.Framework.Scenes public osUTF8 osUTF8Text; public string Text { - get { return osUTF8Text.ToString(); } - set { osUTF8Text = new osUTF8(value, 254); } + get { return osUTF8Text == null ? string.Empty : osUTF8Text.ToString(); } + set { osUTF8Text = string.IsNullOrEmpty(value) ? null : new osUTF8(value, 254); } } public osUTF8 osUTF8SitName; public string SitName { - get { return osUTF8SitName.ToString(); } - set { osUTF8SitName = new osUTF8(value, 36); } + get { return osUTF8SitName == null ? string.Empty : osUTF8SitName.ToString(); } + set { osUTF8SitName = string.IsNullOrEmpty(value) ? null : new osUTF8(value, 36); } } public osUTF8 osUTF8TouchName; public string TouchName { - get { return osUTF8TouchName.ToString(); } - set { osUTF8TouchName = new osUTF8(value, 36); } + get { return osUTF8TouchName == null ? string.Empty : osUTF8TouchName.ToString(); } + set { osUTF8TouchName = string.IsNullOrEmpty(value) ? null : new osUTF8(value, 36); } } public int LinkNum @@ -1196,18 +1201,25 @@ namespace OpenSim.Region.Framework.Scenes { get { - if(osUTFMediaUrl.Length == 0) - return null; - return osUTFMediaUrl.ToString(); + return osUTFMediaUrl == null ? string.Empty : osUTFMediaUrl.ToString(); } set { osUTF8 old = osUTFMediaUrl; - osUTFMediaUrl = new osUTF8(value, 254); + if (string.IsNullOrEmpty(value)) + { + osUTFMediaUrl = null; + if (old != null && ParentGroup != null) + ParentGroup.HasGroupChanged = true; + } + else + { + osUTFMediaUrl = new osUTF8(value, 254); - if (ParentGroup != null && !osUTFMediaUrl.Equals(old)) - ParentGroup.HasGroupChanged = true; + if (ParentGroup != null && !osUTFMediaUrl.Equals(old)) + ParentGroup.HasGroupChanged = true; + } } } diff --git a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs index adfbd6fb8c..accbfe7b49 100644 --- a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs +++ b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs @@ -828,7 +828,7 @@ namespace OpenSim.Region.Framework.Scenes if(parts[0].Length == 0) continue; parts[0].SelfTrim(wearableSeps); - if (parts[0].ToString() == "parameters") + if (parts[0].Equals(parametersB)) { if (parts[1].Length == 0) return; @@ -841,7 +841,7 @@ namespace OpenSim.Region.Framework.Scenes return; } } - else if (parts[0].ToString() == "textures") + else if (parts[0].Equals(texturesB)) { if(parts[1].Length == 0) return; @@ -960,18 +960,20 @@ namespace OpenSim.Region.Framework.Scenes // bad ugly - private static osUTF8 UUIDB = new osUTF8("UUID"); - private static osUTF8 uuidB = new osUTF8("uuid"); - private static osUTF8 SOPAnimsB = new osUTF8("SOPAnims"); - private static osUTF8 CollisionSoundB = new osUTF8("CollisionSound"); - private static osUTF8 SoundIDB = new osUTF8("SoundID"); - private static osUTF8 SculptTextureB = new osUTF8("SculptTexture"); - private static osUTF8 ExtraParamsB = new osUTF8("ExtraParams"); - private static osUTF8 ParticleSystemB = new osUTF8("ParticleSystem"); - private static osUTF8 TextureEntryB = new osUTF8("TextureEntry"); - private static osUTF8 TaskInventoryB = new osUTF8("TaskInventory"); - private static osUTF8 endTaskInventoryB = new osUTF8("/TaskInventory"); + private static osUTF8 UUIDB = new osUTF8("UUID", true); + private static osUTF8 uuidB = new osUTF8("uuid", true); + private static osUTF8 SOPAnimsB = new osUTF8("SOPAnims", true); + private static osUTF8 CollisionSoundB = new osUTF8("CollisionSound", true); + private static osUTF8 SoundIDB = new osUTF8("SoundID", true); + private static osUTF8 SculptTextureB = new osUTF8("SculptTexture", true); + private static osUTF8 ExtraParamsB = new osUTF8("ExtraParams", true); + private static osUTF8 ParticleSystemB = new osUTF8("ParticleSystem", true); + private static osUTF8 TextureEntryB = new osUTF8("TextureEntry", true); + private static osUTF8 TaskInventoryB = new osUTF8("TaskInventory", true); + private static osUTF8 endTaskInventoryB = new osUTF8("/TaskInventory", true); private static osUTF8 AssetIDB = new osUTF8("AssetID"); + private static osUTF8 texturesB = new osUTF8("textures", true); + private static osUTF8 parametersB = new osUTF8("parameters", true); /// /// Get all the asset uuids associated with a given object. This includes both those directly associated with diff --git a/bin/OpenMetaverse.Rendering.Meshmerizer.dll b/bin/OpenMetaverse.Rendering.Meshmerizer.dll index 0af14a3bb3..b865c5cb7a 100755 Binary files a/bin/OpenMetaverse.Rendering.Meshmerizer.dll and b/bin/OpenMetaverse.Rendering.Meshmerizer.dll differ diff --git a/bin/OpenMetaverse.StructuredData.dll b/bin/OpenMetaverse.StructuredData.dll index f22646d28a..6bfd46afc9 100755 Binary files a/bin/OpenMetaverse.StructuredData.dll and b/bin/OpenMetaverse.StructuredData.dll differ diff --git a/bin/OpenMetaverse.dll b/bin/OpenMetaverse.dll index fa3c483233..f1f0112717 100755 Binary files a/bin/OpenMetaverse.dll and b/bin/OpenMetaverse.dll differ diff --git a/bin/OpenMetaverseTypes.dll b/bin/OpenMetaverseTypes.dll index a581c9a167..2306ecb97b 100755 Binary files a/bin/OpenMetaverseTypes.dll and b/bin/OpenMetaverseTypes.dll differ