diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 75 |
1 files changed, 67 insertions, 8 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index c176c2b..a34ad62 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |||
@@ -574,22 +574,42 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
574 | return result; | 574 | return result; |
575 | } | 575 | } |
576 | 576 | ||
577 | /// <summary> | ||
578 | /// Add a handler for the given packet type. | ||
579 | /// </summary> | ||
580 | /// <remarks>The packet is handled on its own thread. If packets must be handled in the order in which thye | ||
581 | /// are received then please us ethe synchronous version of this method.</remarks> | ||
582 | /// <param name="packetType"></param> | ||
583 | /// <param name="handler"></param> | ||
584 | /// <returns>true if the handler was added. This is currently always the case.</returns> | ||
577 | public bool AddLocalPacketHandler(PacketType packetType, PacketMethod handler) | 585 | public bool AddLocalPacketHandler(PacketType packetType, PacketMethod handler) |
578 | { | 586 | { |
579 | return AddLocalPacketHandler(packetType, handler, true); | 587 | return AddLocalPacketHandler(packetType, handler, true); |
580 | } | 588 | } |
581 | 589 | ||
582 | public bool AddLocalPacketHandler(PacketType packetType, PacketMethod handler, bool async) | 590 | /// <summary> |
591 | /// Add a handler for the given packet type. | ||
592 | /// </summary> | ||
593 | /// <param name="packetType"></param> | ||
594 | /// <param name="handler"></param> | ||
595 | /// <param name="doAsync"> | ||
596 | /// If true, when the packet is received it is handled on its own thread rather than on the main inward bound | ||
597 | /// packet handler thread. This vastly increases respnosiveness but some packets need to be handled | ||
598 | /// synchronously. | ||
599 | /// </param> | ||
600 | /// <returns>true if the handler was added. This is currently always the case.</returns> | ||
601 | public bool AddLocalPacketHandler(PacketType packetType, PacketMethod handler, bool doAsync) | ||
583 | { | 602 | { |
584 | bool result = false; | 603 | bool result = false; |
585 | lock (m_packetHandlers) | 604 | lock (m_packetHandlers) |
586 | { | 605 | { |
587 | if (!m_packetHandlers.ContainsKey(packetType)) | 606 | if (!m_packetHandlers.ContainsKey(packetType)) |
588 | { | 607 | { |
589 | m_packetHandlers.Add(packetType, new PacketProcessor() { method = handler, Async = async }); | 608 | m_packetHandlers.Add(packetType, new PacketProcessor() { method = handler, Async = doAsync }); |
590 | result = true; | 609 | result = true; |
591 | } | 610 | } |
592 | } | 611 | } |
612 | |||
593 | return result; | 613 | return result; |
594 | } | 614 | } |
595 | 615 | ||
@@ -11200,8 +11220,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11200 | protected bool HandleMultipleObjUpdate(IClientAPI simClient, Packet packet) | 11220 | protected bool HandleMultipleObjUpdate(IClientAPI simClient, Packet packet) |
11201 | { | 11221 | { |
11202 | MultipleObjectUpdatePacket multipleupdate = (MultipleObjectUpdatePacket)packet; | 11222 | MultipleObjectUpdatePacket multipleupdate = (MultipleObjectUpdatePacket)packet; |
11203 | if (multipleupdate.AgentData.SessionID != SessionId) return false; | 11223 | |
11204 | // m_log.Debug("new multi update packet " + multipleupdate.ToString()); | 11224 | if (multipleupdate.AgentData.SessionID != SessionId) |
11225 | return false; | ||
11226 | |||
11227 | // m_log.DebugFormat( | ||
11228 | // "[CLIENT]: Incoming MultipleObjectUpdatePacket contained {0} blocks", multipleupdate.ObjectData.Length); | ||
11229 | |||
11205 | Scene tScene = (Scene)m_scene; | 11230 | Scene tScene = (Scene)m_scene; |
11206 | 11231 | ||
11207 | for (int i = 0; i < multipleupdate.ObjectData.Length; i++) | 11232 | for (int i = 0; i < multipleupdate.ObjectData.Length; i++) |
@@ -11222,7 +11247,18 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11222 | } | 11247 | } |
11223 | else | 11248 | else |
11224 | { | 11249 | { |
11225 | // UUID partId = part.UUID; | 11250 | // m_log.DebugFormat( |
11251 | // "[CLIENT]: Processing block {0} type {1} for {2} {3}", | ||
11252 | // i, block.Type, part.Name, part.LocalId); | ||
11253 | |||
11254 | // // Do this once since fetch parts creates a new array. | ||
11255 | // SceneObjectPart[] parts = part.ParentGroup.Parts; | ||
11256 | // for (int j = 0; j < parts.Length; j++) | ||
11257 | // { | ||
11258 | // part.StoreUndoState(); | ||
11259 | // parts[j].IgnoreUndoUpdate = true; | ||
11260 | // } | ||
11261 | |||
11226 | UpdatePrimGroupRotation handlerUpdatePrimGroupRotation; | 11262 | UpdatePrimGroupRotation handlerUpdatePrimGroupRotation; |
11227 | 11263 | ||
11228 | switch (block.Type) | 11264 | switch (block.Type) |
@@ -11237,6 +11273,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11237 | handlerUpdatePrimSinglePosition(localId, pos1, this); | 11273 | handlerUpdatePrimSinglePosition(localId, pos1, this); |
11238 | } | 11274 | } |
11239 | break; | 11275 | break; |
11276 | |||
11240 | case 2: | 11277 | case 2: |
11241 | Quaternion rot1 = new Quaternion(block.Data, 0, true); | 11278 | Quaternion rot1 = new Quaternion(block.Data, 0, true); |
11242 | 11279 | ||
@@ -11247,6 +11284,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11247 | handlerUpdatePrimSingleRotation(localId, rot1, this); | 11284 | handlerUpdatePrimSingleRotation(localId, rot1, this); |
11248 | } | 11285 | } |
11249 | break; | 11286 | break; |
11287 | |||
11250 | case 3: | 11288 | case 3: |
11251 | Vector3 rotPos = new Vector3(block.Data, 0); | 11289 | Vector3 rotPos = new Vector3(block.Data, 0); |
11252 | Quaternion rot2 = new Quaternion(block.Data, 12, true); | 11290 | Quaternion rot2 = new Quaternion(block.Data, 12, true); |
@@ -11259,6 +11297,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11259 | handlerUpdatePrimSingleRotationPosition(localId, rot2, rotPos, this); | 11297 | handlerUpdatePrimSingleRotationPosition(localId, rot2, rotPos, this); |
11260 | } | 11298 | } |
11261 | break; | 11299 | break; |
11300 | |||
11262 | case 4: | 11301 | case 4: |
11263 | case 20: | 11302 | case 20: |
11264 | Vector3 scale4 = new Vector3(block.Data, 0); | 11303 | Vector3 scale4 = new Vector3(block.Data, 0); |
@@ -11270,8 +11309,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11270 | handlerUpdatePrimScale(localId, scale4, this); | 11309 | handlerUpdatePrimScale(localId, scale4, this); |
11271 | } | 11310 | } |
11272 | break; | 11311 | break; |
11273 | case 5: | ||
11274 | 11312 | ||
11313 | case 5: | ||
11275 | Vector3 scale1 = new Vector3(block.Data, 12); | 11314 | Vector3 scale1 = new Vector3(block.Data, 12); |
11276 | Vector3 pos11 = new Vector3(block.Data, 0); | 11315 | Vector3 pos11 = new Vector3(block.Data, 0); |
11277 | 11316 | ||
@@ -11288,6 +11327,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11288 | } | 11327 | } |
11289 | } | 11328 | } |
11290 | break; | 11329 | break; |
11330 | |||
11291 | case 9: | 11331 | case 9: |
11292 | Vector3 pos2 = new Vector3(block.Data, 0); | 11332 | Vector3 pos2 = new Vector3(block.Data, 0); |
11293 | 11333 | ||
@@ -11295,10 +11335,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11295 | 11335 | ||
11296 | if (handlerUpdateVector != null) | 11336 | if (handlerUpdateVector != null) |
11297 | { | 11337 | { |
11298 | |||
11299 | handlerUpdateVector(localId, pos2, this); | 11338 | handlerUpdateVector(localId, pos2, this); |
11300 | } | 11339 | } |
11301 | break; | 11340 | break; |
11341 | |||
11302 | case 10: | 11342 | case 10: |
11303 | Quaternion rot3 = new Quaternion(block.Data, 0, true); | 11343 | Quaternion rot3 = new Quaternion(block.Data, 0, true); |
11304 | 11344 | ||
@@ -11309,6 +11349,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11309 | handlerUpdatePrimRotation(localId, rot3, this); | 11349 | handlerUpdatePrimRotation(localId, rot3, this); |
11310 | } | 11350 | } |
11311 | break; | 11351 | break; |
11352 | |||
11312 | case 11: | 11353 | case 11: |
11313 | Vector3 pos3 = new Vector3(block.Data, 0); | 11354 | Vector3 pos3 = new Vector3(block.Data, 0); |
11314 | Quaternion rot4 = new Quaternion(block.Data, 12, true); | 11355 | Quaternion rot4 = new Quaternion(block.Data, 12, true); |
@@ -11332,6 +11373,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11332 | handlerUpdatePrimGroupScale(localId, scale7, this); | 11373 | handlerUpdatePrimGroupScale(localId, scale7, this); |
11333 | } | 11374 | } |
11334 | break; | 11375 | break; |
11376 | |||
11335 | case 13: | 11377 | case 13: |
11336 | Vector3 scale2 = new Vector3(block.Data, 12); | 11378 | Vector3 scale2 = new Vector3(block.Data, 12); |
11337 | Vector3 pos4 = new Vector3(block.Data, 0); | 11379 | Vector3 pos4 = new Vector3(block.Data, 0); |
@@ -11351,6 +11393,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11351 | } | 11393 | } |
11352 | } | 11394 | } |
11353 | break; | 11395 | break; |
11396 | |||
11354 | case 29: | 11397 | case 29: |
11355 | Vector3 scale5 = new Vector3(block.Data, 12); | 11398 | Vector3 scale5 = new Vector3(block.Data, 12); |
11356 | Vector3 pos5 = new Vector3(block.Data, 0); | 11399 | Vector3 pos5 = new Vector3(block.Data, 0); |
@@ -11359,6 +11402,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11359 | if (handlerUpdatePrimGroupScale != null) | 11402 | if (handlerUpdatePrimGroupScale != null) |
11360 | { | 11403 | { |
11361 | // m_log.Debug("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z); | 11404 | // m_log.Debug("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z); |
11405 | part.StoreUndoState(true); | ||
11406 | part.IgnoreUndoUpdate = true; | ||
11362 | handlerUpdatePrimGroupScale(localId, scale5, this); | 11407 | handlerUpdatePrimGroupScale(localId, scale5, this); |
11363 | handlerUpdateVector = OnUpdatePrimGroupPosition; | 11408 | handlerUpdateVector = OnUpdatePrimGroupPosition; |
11364 | 11409 | ||
@@ -11366,8 +11411,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11366 | { | 11411 | { |
11367 | handlerUpdateVector(localId, pos5, this); | 11412 | handlerUpdateVector(localId, pos5, this); |
11368 | } | 11413 | } |
11414 | |||
11415 | part.IgnoreUndoUpdate = false; | ||
11369 | } | 11416 | } |
11417 | |||
11370 | break; | 11418 | break; |
11419 | |||
11371 | case 21: | 11420 | case 21: |
11372 | Vector3 scale6 = new Vector3(block.Data, 12); | 11421 | Vector3 scale6 = new Vector3(block.Data, 12); |
11373 | Vector3 pos6 = new Vector3(block.Data, 0); | 11422 | Vector3 pos6 = new Vector3(block.Data, 0); |
@@ -11375,6 +11424,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11375 | handlerUpdatePrimScale = OnUpdatePrimScale; | 11424 | handlerUpdatePrimScale = OnUpdatePrimScale; |
11376 | if (handlerUpdatePrimScale != null) | 11425 | if (handlerUpdatePrimScale != null) |
11377 | { | 11426 | { |
11427 | part.StoreUndoState(false); | ||
11428 | part.IgnoreUndoUpdate = true; | ||
11429 | |||
11378 | // m_log.Debug("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z); | 11430 | // m_log.Debug("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z); |
11379 | handlerUpdatePrimScale(localId, scale6, this); | 11431 | handlerUpdatePrimScale(localId, scale6, this); |
11380 | handlerUpdatePrimSinglePosition = OnUpdatePrimSinglePosition; | 11432 | handlerUpdatePrimSinglePosition = OnUpdatePrimSinglePosition; |
@@ -11382,15 +11434,22 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11382 | { | 11434 | { |
11383 | handlerUpdatePrimSinglePosition(localId, pos6, this); | 11435 | handlerUpdatePrimSinglePosition(localId, pos6, this); |
11384 | } | 11436 | } |
11437 | |||
11438 | part.IgnoreUndoUpdate = false; | ||
11385 | } | 11439 | } |
11386 | break; | 11440 | break; |
11441 | |||
11387 | default: | 11442 | default: |
11388 | m_log.Debug("[CLIENT] MultipleObjUpdate recieved an unknown packet type: " + (block.Type)); | 11443 | m_log.Debug("[CLIENT]: MultipleObjUpdate recieved an unknown packet type: " + (block.Type)); |
11389 | break; | 11444 | break; |
11390 | } | 11445 | } |
11446 | |||
11447 | // for (int j = 0; j < parts.Length; j++) | ||
11448 | // parts[j].IgnoreUndoUpdate = false; | ||
11391 | } | 11449 | } |
11392 | } | 11450 | } |
11393 | } | 11451 | } |
11452 | |||
11394 | return true; | 11453 | return true; |
11395 | } | 11454 | } |
11396 | 11455 | ||