BUG FIX: change lludp hovertext utf-8 cut point. Thx djphil

0.9.0-post-fixes
UbitUmarov 2017-06-28 01:29:49 +01:00
parent 936aee412d
commit b0a0163253
3 changed files with 9 additions and 9 deletions

View File

@ -2221,9 +2221,9 @@ namespace OpenSim.Framework
// might have gotten an oversized array even after the string trim
byte[] data = UTF8.GetBytes(str);
if (data.Length > 256)
if (data.Length > 255) //play safe
{
int cut = 255;
int cut = 254;
if((data[cut] & 0x80 ) != 0 )
{
while(cut > 0 && (data[cut] & 0xc0) != 0xc0)
@ -2325,7 +2325,7 @@ namespace OpenSim.Framework
if (data.Length > MaxLength)
{
int cut = MaxLength -1 ;
int cut = MaxLength - 1 ;
if((data[cut] & 0x80 ) != 0 )
{
while(cut > 0 && (data[cut] & 0xc0) != 0xc0)

View File

@ -5753,7 +5753,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
//update.JointPivot = Vector3.Zero;
//update.JointType = 0;
update.Material = part.Material;
update.MediaURL = Utils.EmptyBytes; // FIXME: Support this in OpenSim
/*
if (data.ParentGroup.IsAttachment)
{
@ -5832,8 +5831,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
update.TextureAnim = part.TextureAnimation ?? Utils.EmptyBytes;
update.TextureEntry = part.Shape.TextureEntry ?? Utils.EmptyBytes;
update.Scale = part.Shape.Scale;
update.Text = Util.StringToBytes256(part.Text);
update.MediaURL = Util.StringToBytes256(part.MediaUrl);
update.Text = Util.StringToBytes(part.Text, 255);
update.MediaURL = Util.StringToBytes(part.MediaUrl, 255);
#region PrimFlags

View File

@ -1103,8 +1103,8 @@ namespace OpenSim.Region.Framework.Scenes
{
get
{
if (m_text.Length > 255)
return m_text.Substring(0, 254);
if (m_text.Length > 256) // yes > 254
return m_text.Substring(0, 256);
return m_text;
}
set { m_text = value; }
@ -1379,7 +1379,8 @@ namespace OpenSim.Region.Framework.Scenes
public UUID LastOwnerID
{
get { return _lastOwnerID; }
set { _lastOwnerID = value; }
set {
_lastOwnerID = value; }
}
public UUID RezzerID