aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
diff options
context:
space:
mode:
authorUbitUmarov2019-03-07 17:11:52 +0000
committerUbitUmarov2019-03-07 17:11:52 +0000
commit4e7cddc6a8a764a76b270dbb7aeb3a16e2bff56c (patch)
treee72b6e6b4878e2797a6f1355e7e19f42e372d845 /OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
parentmake use of direct object update encoding (diff)
downloadopensim-SC-4e7cddc6a8a764a76b270dbb7aeb3a16e2bff56c.zip
opensim-SC-4e7cddc6a8a764a76b270dbb7aeb3a16e2bff56c.tar.gz
opensim-SC-4e7cddc6a8a764a76b270dbb7aeb3a16e2bff56c.tar.bz2
opensim-SC-4e7cddc6a8a764a76b270dbb7aeb3a16e2bff56c.tar.xz
vegetation is special
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs')
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs99
1 files changed, 71 insertions, 28 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index 171f8c6..f984009 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -6241,20 +6241,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6241 { 6241 {
6242 // prepare data 6242 // prepare data
6243 6243
6244 //NameValue and state
6245 byte[] nv = null;
6246 byte state;
6247 if (part.ParentGroup.IsAttachment)
6248 {
6249 if (part.IsRoot)
6250 nv = Util.StringToBytes256("AttachItemID STRING RW SV " + part.ParentGroup.FromItemID);
6251
6252 int st = (int)part.ParentGroup.AttachmentPoint;
6253 state = (byte)(((st & 0xf0) >> 4) + ((st & 0x0f) << 4)); ;
6254 }
6255 else
6256 state = part.Shape.State; // not sure about this
6257
6258 #region PrimFlags 6244 #region PrimFlags
6259 // prim/update flags 6245 // prim/update flags
6260 PrimFlags primflags = (PrimFlags)m_scene.Permissions.GenerateClientFlags(part, sp); 6246 PrimFlags primflags = (PrimFlags)m_scene.Permissions.GenerateClientFlags(part, sp);
@@ -6271,6 +6257,76 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6271 } 6257 }
6272 #endregion PrimFlags 6258 #endregion PrimFlags
6273 6259
6260 // data block
6261 byte[] data = null;
6262 byte state = part.Shape.State;
6263 PCode pcode = (PCode)part.Shape.PCode;
6264
6265 //vegetation is special so just do it inline
6266 if(pcode == PCode.Grass || pcode == PCode.Tree || pcode == PCode.NewTree)
6267 {
6268 zc.AddUInt(part.LocalId);
6269 zc.AddByte(state); // state
6270 zc.AddUUID(part.UUID);
6271 zc.AddZeros(4); // crc unused
6272 zc.AddByte((byte)pcode);
6273 // material 1
6274 // clickaction 1
6275 zc.AddZeros(2);
6276 zc.AddVector3(part.Shape.Scale);
6277
6278 // objectdata block
6279 zc.AddByte(60); // fixed object block size
6280 zc.AddVector3(part.RelativePosition);
6281 zc.AddZeros(24);
6282 Quaternion rot = part.RotationOffset;
6283 rot.Normalize();
6284 zc.AddNormQuat(rot);
6285 zc.AddZeros(12);
6286
6287 zc.AddUInt(part.ParentID);
6288 zc.AddUInt((uint)primflags); //update flags
6289
6290 //pbs volume data 23
6291 //texture entry 2
6292 //texture anim 1
6293 //name value 2
6294 zc.AddZeros(23 + 2 + 1 + 2);
6295
6296 //data
6297 zc.AddByte(1);
6298 zc.AddZeros(1);
6299 zc.AddByte(state);
6300
6301 // text 5
6302 // media url 1
6303 // particle system 1
6304 // Extraparams 1
6305 // sound id 16
6306 // ownwer 16
6307 // sound gain 4
6308 // sound flags 1
6309 // sound radius 4
6310 // jointtype 1
6311 // joint pivot 12
6312 // joint offset 12
6313 zc.AddZeros(5 + 1 + 1 + 1 + 16 + 16 + 4 + 1 + 4 + 1 + 12 + 12);
6314
6315 return;
6316 }
6317
6318 //NameValue and state
6319 byte[] nv = null;
6320
6321 if (part.ParentGroup.IsAttachment)
6322 {
6323 if (part.IsRoot)
6324 nv = Util.StringToBytes256("AttachItemID STRING RW SV " + part.ParentGroup.FromItemID);
6325
6326 int st = (int)part.ParentGroup.AttachmentPoint;
6327 state = (byte)(((st & 0xf0) >> 4) + ((st & 0x0f) << 4)); ;
6328 }
6329
6274 // filter out mesh faces hack 6330 // filter out mesh faces hack
6275 ushort profileBegin = part.Shape.ProfileBegin; 6331 ushort profileBegin = part.Shape.ProfileBegin;
6276 ushort profileHollow = part.Shape.ProfileHollow; 6332 ushort profileHollow = part.Shape.ProfileHollow;
@@ -6290,25 +6346,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6290 pathScaleY = 150; 6346 pathScaleY = 150;
6291 } 6347 }
6292 6348
6293 // data block
6294 byte[] data = null;
6295 switch ((PCode)part.Shape.PCode)
6296 {
6297 case PCode.Grass:
6298 case PCode.Tree:
6299 case PCode.NewTree:
6300 data = new byte[] { part.Shape.State };
6301 break;
6302 default:
6303 break;
6304 }
6305
6306 // do encode the things 6349 // do encode the things
6307 zc.AddUInt(part.LocalId); 6350 zc.AddUInt(part.LocalId);
6308 zc.AddByte(state); // state 6351 zc.AddByte(state); // state
6309 zc.AddUUID(part.UUID); 6352 zc.AddUUID(part.UUID);
6310 zc.AddZeros(4); // crc unused 6353 zc.AddZeros(4); // crc unused
6311 zc.AddByte(part.Shape.PCode); 6354 zc.AddByte((byte)pcode);
6312 zc.AddByte(part.Material); 6355 zc.AddByte(part.Material);
6313 zc.AddByte(part.ClickAction); // clickaction 6356 zc.AddByte(part.ClickAction); // clickaction
6314 zc.AddVector3(part.Shape.Scale); 6357 zc.AddVector3(part.Shape.Scale);