don't send irrelevant data

0.9.1.0-post-fixes
UbitUmarov 2019-03-07 04:50:05 +00:00
parent fdb1ce827b
commit 9487f5cdd3
1 changed files with 36 additions and 25 deletions

View File

@ -6008,18 +6008,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
zc.AddZeros(4); //update flags zc.AddZeros(4); //update flags
//pbs //pbs volume data 23
zc.AddByte(16); //texture entry 2
zc.AddByte(1); //texture anim (1)
//Utils.UInt16ToBytes(0, dest, pos); pos += 2; const int pbszeros = 23 + 2 + 1;
//Utils.UInt16ToBytes(0, dest, pos); pos += 2;
zc.AddZeros(4);
zc.AddByte(100);
zc.AddByte(100);
// rest of pbs is 0 (15), texture entry (2) and texture anim (1)
const int pbszeros = 15 + 2 + 1;
zc.AddZeros(pbszeros); zc.AddZeros(pbszeros);
//NameValue //NameValue
@ -6154,15 +6146,18 @@ namespace OpenSim.Region.ClientStack.LindenUDP
#endregion PrimFlags #endregion PrimFlags
if (part.Sound != UUID.Zero || part.SoundFlags != 0) bool hassound = part.Sound != UUID.Zero || part.SoundFlags != 0;
if (hassound)
{ {
update.Sound = part.Sound; update.Sound = part.Sound;
update.OwnerID = part.OwnerID;
update.Gain = (float)part.SoundGain; update.Gain = (float)part.SoundGain;
update.Radius = (float)part.SoundRadius; update.Radius = (float)part.SoundRadius;
update.Flags = part.SoundFlags; update.Flags = part.SoundFlags;
} }
if(hassound || update.PSBlock.Length > 1)
update.OwnerID = part.OwnerID;
switch ((PCode)part.Shape.PCode) switch ((PCode)part.Shape.PCode)
{ {
case PCode.Grass: case PCode.Grass:
@ -6333,18 +6328,18 @@ namespace OpenSim.Region.ClientStack.LindenUDP
//text //text
if (part.Text.Length == 0) if (part.Text.Length == 0)
zc.AddZeros(1); zc.AddZeros(5);
else else
{ {
byte[] tbuf = Util.StringToBytes(part.Text, 255); byte[] tbuf = Util.StringToBytes(part.Text, 254);
int len = tbuf.Length; int len = tbuf.Length;
zc.AddByte((byte)len); zc.AddByte((byte)len);
zc.AddBytes(tbuf, len); zc.AddBytes(tbuf, len);
}
//textcolor //textcolor
byte[] tc = part.GetTextColor().GetBytes(false); byte[] tc = part.GetTextColor().GetBytes(false);
zc.AddBytes(tc, 4); zc.AddBytes(tc, 4);
}
//media url //media url
if (part.MediaUrl.Length == 0) if (part.MediaUrl.Length == 0)
@ -6357,6 +6352,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
zc.AddBytes(tbuf, len); zc.AddBytes(tbuf, len);
} }
bool hasps = false;
//particle system //particle system
byte[] ps = part.ParticleSystem; byte[] ps = part.ParticleSystem;
if (ps == null) if (ps == null)
@ -6366,6 +6362,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
int len = ps.Length; int len = ps.Length;
zc.AddByte((byte)len); zc.AddByte((byte)len);
zc.AddBytes(ps, len); zc.AddBytes(ps, len);
hasps = len > 1;
} }
//Extraparams //Extraparams
@ -6379,11 +6376,25 @@ namespace OpenSim.Region.ClientStack.LindenUDP
zc.AddBytes(ep, len); zc.AddBytes(ep, len);
} }
zc.AddUUID(part.Sound); bool hassound = part.Sound != UUID.Zero || part.SoundFlags != 0;
zc.AddUUID(part.OwnerID); if (hassound)
zc.AddFloat((float)part.SoundGain); zc.AddUUID(part.Sound);
zc.AddByte(part.SoundFlags); else
zc.AddFloat((float)part.SoundRadius); zc.AddZeros(16);
if (hassound || hasps)
zc.AddUUID(part.OwnerID);
else
zc.AddZeros(16);
if (hassound)
{
zc.AddFloat((float)part.SoundGain);
zc.AddByte(part.SoundFlags);
zc.AddFloat((float)part.SoundRadius);
}
else
zc.AddZeros(9);
// jointtype(1) joint pivot(12) joint offset(12) // jointtype(1) joint pivot(12) joint offset(12)
const int lastzeros = 1 + 12 + 12; const int lastzeros = 1 + 12 + 12;