diff options
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs')
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 661 |
1 files changed, 380 insertions, 281 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 1f7e66d..803114f 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -157,6 +157,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
157 | public event RequestTaskInventory OnRequestTaskInventory; | 157 | public event RequestTaskInventory OnRequestTaskInventory; |
158 | public event UpdateInventoryItem OnUpdateInventoryItem; | 158 | public event UpdateInventoryItem OnUpdateInventoryItem; |
159 | public event CopyInventoryItem OnCopyInventoryItem; | 159 | public event CopyInventoryItem OnCopyInventoryItem; |
160 | public event MoveItemsAndLeaveCopy OnMoveItemsAndLeaveCopy; | ||
160 | public event MoveInventoryItem OnMoveInventoryItem; | 161 | public event MoveInventoryItem OnMoveInventoryItem; |
161 | public event RemoveInventoryItem OnRemoveInventoryItem; | 162 | public event RemoveInventoryItem OnRemoveInventoryItem; |
162 | public event RemoveInventoryFolder OnRemoveInventoryFolder; | 163 | public event RemoveInventoryFolder OnRemoveInventoryFolder; |
@@ -254,7 +255,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
254 | public event ClassifiedInfoRequest OnClassifiedInfoRequest; | 255 | public event ClassifiedInfoRequest OnClassifiedInfoRequest; |
255 | public event ClassifiedInfoUpdate OnClassifiedInfoUpdate; | 256 | public event ClassifiedInfoUpdate OnClassifiedInfoUpdate; |
256 | public event ClassifiedDelete OnClassifiedDelete; | 257 | public event ClassifiedDelete OnClassifiedDelete; |
257 | public event ClassifiedDelete OnClassifiedGodDelete; | 258 | public event ClassifiedGodDelete OnClassifiedGodDelete; |
258 | public event EventNotificationAddRequest OnEventNotificationAddRequest; | 259 | public event EventNotificationAddRequest OnEventNotificationAddRequest; |
259 | public event EventNotificationRemoveRequest OnEventNotificationRemoveRequest; | 260 | public event EventNotificationRemoveRequest OnEventNotificationRemoveRequest; |
260 | public event EventGodDelete OnEventGodDelete; | 261 | public event EventGodDelete OnEventGodDelete; |
@@ -330,7 +331,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
330 | /// thread servicing the m_primFullUpdates queue after a kill. If this happens the object persists as an | 331 | /// thread servicing the m_primFullUpdates queue after a kill. If this happens the object persists as an |
331 | /// ownerless phantom. | 332 | /// ownerless phantom. |
332 | /// | 333 | /// |
333 | /// All manipulation of this set has to occur under a lock | 334 | /// All manipulation of this set has to occur under an m_entityUpdates.SyncRoot lock |
334 | /// | 335 | /// |
335 | /// </value> | 336 | /// </value> |
336 | protected HashSet<uint> m_killRecord; | 337 | protected HashSet<uint> m_killRecord; |
@@ -338,6 +339,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
338 | // protected HashSet<uint> m_attachmentsSent; | 339 | // protected HashSet<uint> m_attachmentsSent; |
339 | 340 | ||
340 | private int m_moneyBalance; | 341 | private int m_moneyBalance; |
342 | private bool m_deliverPackets = true; | ||
341 | private int m_animationSequenceNumber = 1; | 343 | private int m_animationSequenceNumber = 1; |
342 | private bool m_SendLogoutPacketWhenClosing = true; | 344 | private bool m_SendLogoutPacketWhenClosing = true; |
343 | private AgentUpdateArgs lastarg; | 345 | private AgentUpdateArgs lastarg; |
@@ -378,6 +380,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
378 | get { return m_startpos; } | 380 | get { return m_startpos; } |
379 | set { m_startpos = value; } | 381 | set { m_startpos = value; } |
380 | } | 382 | } |
383 | public bool DeliverPackets | ||
384 | { | ||
385 | get { return m_deliverPackets; } | ||
386 | set { | ||
387 | m_deliverPackets = value; | ||
388 | m_udpClient.m_deliverPackets = value; | ||
389 | } | ||
390 | } | ||
381 | public UUID AgentId { get { return m_agentId; } } | 391 | public UUID AgentId { get { return m_agentId; } } |
382 | public UUID ActiveGroupId { get { return m_activeGroupID; } } | 392 | public UUID ActiveGroupId { get { return m_activeGroupID; } } |
383 | public string ActiveGroupName { get { return m_activeGroupName; } } | 393 | public string ActiveGroupName { get { return m_activeGroupName; } } |
@@ -474,18 +484,30 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
474 | 484 | ||
475 | #region Client Methods | 485 | #region Client Methods |
476 | 486 | ||
487 | |||
477 | /// <summary> | 488 | /// <summary> |
478 | /// Shut down the client view | 489 | /// Shut down the client view |
479 | /// </summary> | 490 | /// </summary> |
480 | public void Close() | 491 | public void Close() |
481 | { | 492 | { |
493 | Close(true); | ||
494 | } | ||
495 | |||
496 | /// <summary> | ||
497 | /// Shut down the client view | ||
498 | /// </summary> | ||
499 | public void Close(bool sendStop) | ||
500 | { | ||
482 | m_log.DebugFormat( | 501 | m_log.DebugFormat( |
483 | "[CLIENT]: Close has been called for {0} attached to scene {1}", | 502 | "[CLIENT]: Close has been called for {0} attached to scene {1}", |
484 | Name, m_scene.RegionInfo.RegionName); | 503 | Name, m_scene.RegionInfo.RegionName); |
485 | 504 | ||
486 | // Send the STOP packet | 505 | if (sendStop) |
487 | DisableSimulatorPacket disable = (DisableSimulatorPacket)PacketPool.Instance.GetPacket(PacketType.DisableSimulator); | 506 | { |
488 | OutPacket(disable, ThrottleOutPacketType.Unknown); | 507 | // Send the STOP packet |
508 | DisableSimulatorPacket disable = (DisableSimulatorPacket)PacketPool.Instance.GetPacket(PacketType.DisableSimulator); | ||
509 | OutPacket(disable, ThrottleOutPacketType.Unknown); | ||
510 | } | ||
489 | 511 | ||
490 | IsActive = false; | 512 | IsActive = false; |
491 | 513 | ||
@@ -766,7 +788,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
766 | reply.ChatData.OwnerID = fromAgentID; | 788 | reply.ChatData.OwnerID = fromAgentID; |
767 | reply.ChatData.SourceID = fromAgentID; | 789 | reply.ChatData.SourceID = fromAgentID; |
768 | 790 | ||
769 | OutPacket(reply, ThrottleOutPacketType.Task); | 791 | OutPacket(reply, ThrottleOutPacketType.Unknown); |
770 | } | 792 | } |
771 | 793 | ||
772 | /// <summary> | 794 | /// <summary> |
@@ -1052,6 +1074,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1052 | public virtual void SendLayerData(float[] map) | 1074 | public virtual void SendLayerData(float[] map) |
1053 | { | 1075 | { |
1054 | Util.FireAndForget(DoSendLayerData, map); | 1076 | Util.FireAndForget(DoSendLayerData, map); |
1077 | |||
1078 | // Send it sync, and async. It's not that much data | ||
1079 | // and it improves user experience just so much! | ||
1080 | DoSendLayerData(map); | ||
1055 | } | 1081 | } |
1056 | 1082 | ||
1057 | /// <summary> | 1083 | /// <summary> |
@@ -1064,16 +1090,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1064 | 1090 | ||
1065 | try | 1091 | try |
1066 | { | 1092 | { |
1067 | //for (int y = 0; y < 16; y++) | 1093 | for (int y = 0; y < 16; y++) |
1068 | //{ | 1094 | { |
1069 | // for (int x = 0; x < 16; x++) | 1095 | for (int x = 0; x < 16; x+=4) |
1070 | // { | 1096 | { |
1071 | // SendLayerData(x, y, map); | 1097 | SendLayerPacket(x, y, map); |
1072 | // } | 1098 | } |
1073 | //} | 1099 | } |
1074 | |||
1075 | // Send LayerData in a spiral pattern. Fun! | ||
1076 | SendLayerTopRight(map, 0, 0, 15, 15); | ||
1077 | } | 1100 | } |
1078 | catch (Exception e) | 1101 | catch (Exception e) |
1079 | { | 1102 | { |
@@ -1081,51 +1104,35 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1081 | } | 1104 | } |
1082 | } | 1105 | } |
1083 | 1106 | ||
1084 | private void SendLayerTopRight(float[] map, int x1, int y1, int x2, int y2) | ||
1085 | { | ||
1086 | // Row | ||
1087 | for (int i = x1; i <= x2; i++) | ||
1088 | SendLayerData(i, y1, map); | ||
1089 | |||
1090 | // Column | ||
1091 | for (int j = y1 + 1; j <= y2; j++) | ||
1092 | SendLayerData(x2, j, map); | ||
1093 | |||
1094 | if (x2 - x1 > 0) | ||
1095 | SendLayerBottomLeft(map, x1, y1 + 1, x2 - 1, y2); | ||
1096 | } | ||
1097 | |||
1098 | void SendLayerBottomLeft(float[] map, int x1, int y1, int x2, int y2) | ||
1099 | { | ||
1100 | // Row in reverse | ||
1101 | for (int i = x2; i >= x1; i--) | ||
1102 | SendLayerData(i, y2, map); | ||
1103 | |||
1104 | // Column in reverse | ||
1105 | for (int j = y2 - 1; j >= y1; j--) | ||
1106 | SendLayerData(x1, j, map); | ||
1107 | |||
1108 | if (x2 - x1 > 0) | ||
1109 | SendLayerTopRight(map, x1 + 1, y1, x2, y2 - 1); | ||
1110 | } | ||
1111 | |||
1112 | /// <summary> | 1107 | /// <summary> |
1113 | /// Sends a set of four patches (x, x+1, ..., x+3) to the client | 1108 | /// Sends a set of four patches (x, x+1, ..., x+3) to the client |
1114 | /// </summary> | 1109 | /// </summary> |
1115 | /// <param name="map">heightmap</param> | 1110 | /// <param name="map">heightmap</param> |
1116 | /// <param name="px">X coordinate for patches 0..12</param> | 1111 | /// <param name="px">X coordinate for patches 0..12</param> |
1117 | /// <param name="py">Y coordinate for patches 0..15</param> | 1112 | /// <param name="py">Y coordinate for patches 0..15</param> |
1118 | // private void SendLayerPacket(float[] map, int y, int x) | 1113 | private void SendLayerPacket(int x, int y, float[] map) |
1119 | // { | 1114 | { |
1120 | // int[] patches = new int[4]; | 1115 | int[] patches = new int[4]; |
1121 | // patches[0] = x + 0 + y * 16; | 1116 | patches[0] = x + 0 + y * 16; |
1122 | // patches[1] = x + 1 + y * 16; | 1117 | patches[1] = x + 1 + y * 16; |
1123 | // patches[2] = x + 2 + y * 16; | 1118 | patches[2] = x + 2 + y * 16; |
1124 | // patches[3] = x + 3 + y * 16; | 1119 | patches[3] = x + 3 + y * 16; |
1125 | 1120 | ||
1126 | // Packet layerpack = LLClientView.TerrainManager.CreateLandPacket(map, patches); | 1121 | float[] heightmap = (map.Length == 65536) ? |
1127 | // OutPacket(layerpack, ThrottleOutPacketType.Land); | 1122 | map : |
1128 | // } | 1123 | LLHeightFieldMoronize(map); |
1124 | |||
1125 | try | ||
1126 | { | ||
1127 | Packet layerpack = TerrainCompressor.CreateLandPacket(heightmap, patches); | ||
1128 | OutPacket(layerpack, ThrottleOutPacketType.Land); | ||
1129 | } | ||
1130 | catch | ||
1131 | { | ||
1132 | for (int px = x ; px < x + 4 ; px++) | ||
1133 | SendLayerData(px, y, map); | ||
1134 | } | ||
1135 | } | ||
1129 | 1136 | ||
1130 | /// <summary> | 1137 | /// <summary> |
1131 | /// Sends a specified patch to a client | 1138 | /// Sends a specified patch to a client |
@@ -1145,7 +1152,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1145 | LayerDataPacket layerpack = TerrainCompressor.CreateLandPacket(heightmap, patches); | 1152 | LayerDataPacket layerpack = TerrainCompressor.CreateLandPacket(heightmap, patches); |
1146 | layerpack.Header.Reliable = true; | 1153 | layerpack.Header.Reliable = true; |
1147 | 1154 | ||
1148 | OutPacket(layerpack, ThrottleOutPacketType.Land); | 1155 | OutPacket(layerpack, ThrottleOutPacketType.Task); |
1149 | } | 1156 | } |
1150 | catch (Exception e) | 1157 | catch (Exception e) |
1151 | { | 1158 | { |
@@ -1506,38 +1513,49 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1506 | OutPacket(pc, ThrottleOutPacketType.Unknown); | 1513 | OutPacket(pc, ThrottleOutPacketType.Unknown); |
1507 | } | 1514 | } |
1508 | 1515 | ||
1509 | public void SendKillObject(ulong regionHandle, uint localID) | 1516 | public void SendKillObject(ulong regionHandle, List<uint> localIDs) |
1510 | { | 1517 | { |
1511 | // m_log.DebugFormat("[CLIENT]: Sending KillObjectPacket to {0} for {1} in {2}", Name, localID, regionHandle); | 1518 | // m_log.DebugFormat("[CLIENT]: Sending KillObjectPacket to {0} for {1} in {2}", Name, localID, regionHandle); |
1512 | 1519 | ||
1513 | KillObjectPacket kill = (KillObjectPacket)PacketPool.Instance.GetPacket(PacketType.KillObject); | 1520 | KillObjectPacket kill = (KillObjectPacket)PacketPool.Instance.GetPacket(PacketType.KillObject); |
1514 | // TODO: don't create new blocks if recycling an old packet | 1521 | // TODO: don't create new blocks if recycling an old packet |
1515 | kill.ObjectData = new KillObjectPacket.ObjectDataBlock[1]; | 1522 | kill.ObjectData = new KillObjectPacket.ObjectDataBlock[localIDs.Count]; |
1516 | kill.ObjectData[0] = new KillObjectPacket.ObjectDataBlock(); | 1523 | for (int i = 0 ; i < localIDs.Count ; i++ ) |
1517 | kill.ObjectData[0].ID = localID; | 1524 | { |
1525 | kill.ObjectData[i] = new KillObjectPacket.ObjectDataBlock(); | ||
1526 | kill.ObjectData[i].ID = localIDs[i]; | ||
1527 | } | ||
1518 | kill.Header.Reliable = true; | 1528 | kill.Header.Reliable = true; |
1519 | kill.Header.Zerocoded = true; | 1529 | kill.Header.Zerocoded = true; |
1520 | 1530 | ||
1521 | if (m_scene.GetScenePresence(localID) == null) | 1531 | lock (m_killRecord) |
1522 | { | 1532 | { |
1523 | // We must lock for both manipulating the kill record and sending the packet, in order to avoid a race | 1533 | if (localIDs.Count == 1) |
1524 | // condition where a kill can be processed before an out-of-date update for the same object. | ||
1525 | lock (m_killRecord) | ||
1526 | { | 1534 | { |
1527 | m_killRecord.Add(localID); | 1535 | if (m_scene.GetScenePresence(localIDs[0]) != null) |
1528 | 1536 | { | |
1529 | // The throttle queue used here must match that being used for updates. Otherwise, there is a | 1537 | OutPacket(kill, ThrottleOutPacketType.State); |
1530 | // chance that a kill packet put on a separate queue will be sent to the client before an existing | 1538 | return; |
1531 | // update packet on another queue. Receiving updates after kills results in unowned and undeletable | 1539 | } |
1532 | // scene objects in a viewer until that viewer is relogged in. | 1540 | m_killRecord.Add(localIDs[0]); |
1533 | OutPacket(kill, ThrottleOutPacketType.Task); | 1541 | } |
1542 | else | ||
1543 | { | ||
1544 | lock (m_entityUpdates.SyncRoot) | ||
1545 | { | ||
1546 | foreach (uint localID in localIDs) | ||
1547 | m_killRecord.Add(localID); | ||
1548 | } | ||
1534 | } | 1549 | } |
1535 | } | 1550 | } |
1536 | else | 1551 | |
1537 | { | 1552 | // The throttle queue used here must match that being used for |
1538 | // OutPacket(kill, ThrottleOutPacketType.State); | 1553 | // updates. Otherwise, there is a chance that a kill packet put |
1539 | OutPacket(kill, ThrottleOutPacketType.Task); | 1554 | // on a separate queue will be sent to the client before an |
1540 | } | 1555 | // existing update packet on another queue. Receiving updates |
1556 | // after kills results in unowned and undeletable | ||
1557 | // scene objects in a viewer until that viewer is relogged in. | ||
1558 | OutPacket(kill, ThrottleOutPacketType.Task); | ||
1541 | } | 1559 | } |
1542 | 1560 | ||
1543 | /// <summary> | 1561 | /// <summary> |
@@ -2250,6 +2268,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
2250 | OutPacket(sound, ThrottleOutPacketType.Task); | 2268 | OutPacket(sound, ThrottleOutPacketType.Task); |
2251 | } | 2269 | } |
2252 | 2270 | ||
2271 | public void SendTransferAbort(TransferRequestPacket transferRequest) | ||
2272 | { | ||
2273 | TransferAbortPacket abort = (TransferAbortPacket)PacketPool.Instance.GetPacket(PacketType.TransferAbort); | ||
2274 | abort.TransferInfo.TransferID = transferRequest.TransferInfo.TransferID; | ||
2275 | abort.TransferInfo.ChannelType = transferRequest.TransferInfo.ChannelType; | ||
2276 | m_log.Debug("[Assets] Aborting transfer; asset request failed"); | ||
2277 | OutPacket(abort, ThrottleOutPacketType.Task); | ||
2278 | } | ||
2279 | |||
2253 | public void SendTriggeredSound(UUID soundID, UUID ownerID, UUID objectID, UUID parentID, ulong handle, Vector3 position, float gain) | 2280 | public void SendTriggeredSound(UUID soundID, UUID ownerID, UUID objectID, UUID parentID, ulong handle, Vector3 position, float gain) |
2254 | { | 2281 | { |
2255 | SoundTriggerPacket sound = (SoundTriggerPacket)PacketPool.Instance.GetPacket(PacketType.SoundTrigger); | 2282 | SoundTriggerPacket sound = (SoundTriggerPacket)PacketPool.Instance.GetPacket(PacketType.SoundTrigger); |
@@ -3554,7 +3581,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3554 | /// </summary> | 3581 | /// </summary> |
3555 | public void SendPrimUpdate(ISceneEntity entity, PrimUpdateFlags updateFlags) | 3582 | public void SendPrimUpdate(ISceneEntity entity, PrimUpdateFlags updateFlags) |
3556 | { | 3583 | { |
3557 | //double priority = m_prioritizer.GetUpdatePriority(this, entity); | 3584 | if (entity is SceneObjectPart) |
3585 | { | ||
3586 | SceneObjectPart e = (SceneObjectPart)entity; | ||
3587 | SceneObjectGroup g = e.ParentGroup; | ||
3588 | if (g.RootPart.Shape.State > 30) // HUD | ||
3589 | if (g.OwnerID != AgentId) | ||
3590 | return; // Don't send updates for other people's HUDs | ||
3591 | } | ||
3592 | |||
3558 | uint priority = m_prioritizer.GetUpdatePriority(this, entity); | 3593 | uint priority = m_prioritizer.GetUpdatePriority(this, entity); |
3559 | 3594 | ||
3560 | lock (m_entityUpdates.SyncRoot) | 3595 | lock (m_entityUpdates.SyncRoot) |
@@ -3578,207 +3613,230 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3578 | 3613 | ||
3579 | // We must lock for both manipulating the kill record and sending the packet, in order to avoid a race | 3614 | // We must lock for both manipulating the kill record and sending the packet, in order to avoid a race |
3580 | // condition where a kill can be processed before an out-of-date update for the same object. | 3615 | // condition where a kill can be processed before an out-of-date update for the same object. |
3581 | lock (m_killRecord) | 3616 | float avgTimeDilation = 1.0f; |
3582 | { | 3617 | IEntityUpdate iupdate; |
3583 | float avgTimeDilation = 1.0f; | 3618 | Int32 timeinqueue; // this is just debugging code & can be dropped later |
3584 | IEntityUpdate iupdate; | ||
3585 | Int32 timeinqueue; // this is just debugging code & can be dropped later | ||
3586 | 3619 | ||
3587 | while (updatesThisCall < maxUpdates) | 3620 | while (updatesThisCall < maxUpdates) |
3588 | { | 3621 | { |
3589 | lock (m_entityUpdates.SyncRoot) | 3622 | lock (m_entityUpdates.SyncRoot) |
3590 | if (!m_entityUpdates.TryDequeue(out iupdate, out timeinqueue)) | 3623 | if (!m_entityUpdates.TryDequeue(out iupdate, out timeinqueue)) |
3591 | break; | 3624 | break; |
3592 | 3625 | ||
3593 | EntityUpdate update = (EntityUpdate)iupdate; | 3626 | EntityUpdate update = (EntityUpdate)iupdate; |
3594 | 3627 | ||
3595 | avgTimeDilation += update.TimeDilation; | 3628 | avgTimeDilation += update.TimeDilation; |
3596 | avgTimeDilation *= 0.5f; | 3629 | avgTimeDilation *= 0.5f; |
3597 | 3630 | ||
3598 | if (update.Entity is SceneObjectPart) | 3631 | if (update.Entity is SceneObjectPart) |
3632 | { | ||
3633 | SceneObjectPart part = (SceneObjectPart)update.Entity; | ||
3634 | |||
3635 | // Please do not remove this unless you can demonstrate on the OpenSim mailing list that a client | ||
3636 | // will never receive an update after a prim kill. Even then, keeping the kill record may be a good | ||
3637 | // safety measure. | ||
3638 | // | ||
3639 | // If a Linden Lab 1.23.5 client (and possibly later and earlier) receives an object update | ||
3640 | // after a kill, it will keep displaying the deleted object until relog. OpenSim currently performs | ||
3641 | // updates and kills on different threads with different scheduling strategies, hence this protection. | ||
3642 | // | ||
3643 | // This doesn't appear to apply to child prims - a client will happily ignore these updates | ||
3644 | // after the root prim has been deleted. | ||
3645 | lock (m_killRecord) | ||
3599 | { | 3646 | { |
3600 | SceneObjectPart part = (SceneObjectPart)update.Entity; | ||
3601 | |||
3602 | // Please do not remove this unless you can demonstrate on the OpenSim mailing list that a client | ||
3603 | // will never receive an update after a prim kill. Even then, keeping the kill record may be a good | ||
3604 | // safety measure. | ||
3605 | // | ||
3606 | // If a Linden Lab 1.23.5 client (and possibly later and earlier) receives an object update | ||
3607 | // after a kill, it will keep displaying the deleted object until relog. OpenSim currently performs | ||
3608 | // updates and kills on different threads with different scheduling strategies, hence this protection. | ||
3609 | // | ||
3610 | // This doesn't appear to apply to child prims - a client will happily ignore these updates | ||
3611 | // after the root prim has been deleted. | ||
3612 | if (m_killRecord.Contains(part.LocalId)) | 3647 | if (m_killRecord.Contains(part.LocalId)) |
3613 | { | ||
3614 | // m_log.WarnFormat( | ||
3615 | // "[CLIENT]: Preventing update for prim with local id {0} after client for user {1} told it was deleted", | ||
3616 | // part.LocalId, Name); | ||
3617 | continue; | 3648 | continue; |
3618 | } | 3649 | if (m_killRecord.Contains(part.ParentGroup.RootPart.LocalId)) |
3619 | 3650 | continue; | |
3620 | if (part.ParentGroup.IsAttachment && m_disableFacelights) | 3651 | } |
3652 | |||
3653 | if (part.ParentGroup.IsDeleted) | ||
3654 | continue; | ||
3655 | |||
3656 | if (part.ParentGroup.IsAttachment) | ||
3657 | { // Someone else's HUD, why are we getting these? | ||
3658 | if (part.ParentGroup.OwnerID != AgentId && | ||
3659 | part.ParentGroup.RootPart.Shape.State >= 30) | ||
3660 | continue; | ||
3661 | ScenePresence sp; | ||
3662 | // Owner is not in the sim, don't update it to | ||
3663 | // anyone | ||
3664 | if (!m_scene.TryGetScenePresence(part.OwnerID, out sp)) | ||
3665 | continue; | ||
3666 | |||
3667 | List<SceneObjectGroup> atts = sp.Attachments; | ||
3668 | bool found = false; | ||
3669 | foreach (SceneObjectGroup att in atts) | ||
3621 | { | 3670 | { |
3622 | if (part.ParentGroup.RootPart.Shape.State != (byte)AttachmentPoint.LeftHand && | 3671 | if (att == part.ParentGroup) |
3623 | part.ParentGroup.RootPart.Shape.State != (byte)AttachmentPoint.RightHand) | ||
3624 | { | 3672 | { |
3625 | part.Shape.LightEntry = false; | 3673 | found = true; |
3674 | break; | ||
3626 | } | 3675 | } |
3627 | } | 3676 | } |
3677 | |||
3678 | // It's an attachment of a valid avatar, but | ||
3679 | // doesn't seem to be attached, skip | ||
3680 | if (!found) | ||
3681 | continue; | ||
3628 | } | 3682 | } |
3629 | 3683 | if (part.ParentGroup.IsAttachment && m_disableFacelights) | |
3630 | ++updatesThisCall; | ||
3631 | |||
3632 | #region UpdateFlags to packet type conversion | ||
3633 | |||
3634 | PrimUpdateFlags updateFlags = (PrimUpdateFlags)update.Flags; | ||
3635 | |||
3636 | bool canUseCompressed = true; | ||
3637 | bool canUseImproved = true; | ||
3638 | |||
3639 | // Compressed object updates only make sense for LL primitives | ||
3640 | if (!(update.Entity is SceneObjectPart)) | ||
3641 | { | ||
3642 | canUseCompressed = false; | ||
3643 | } | ||
3644 | |||
3645 | if (updateFlags.HasFlag(PrimUpdateFlags.FullUpdate)) | ||
3646 | { | ||
3647 | canUseCompressed = false; | ||
3648 | canUseImproved = false; | ||
3649 | } | ||
3650 | else | ||
3651 | { | 3684 | { |
3652 | if (updateFlags.HasFlag(PrimUpdateFlags.Velocity) || | 3685 | if (part.ParentGroup.RootPart.Shape.State != (byte)AttachmentPoint.LeftHand && |
3653 | updateFlags.HasFlag(PrimUpdateFlags.Acceleration) || | 3686 | part.ParentGroup.RootPart.Shape.State != (byte)AttachmentPoint.RightHand) |
3654 | updateFlags.HasFlag(PrimUpdateFlags.CollisionPlane) || | ||
3655 | updateFlags.HasFlag(PrimUpdateFlags.Joint)) | ||
3656 | { | 3687 | { |
3657 | canUseCompressed = false; | 3688 | part.Shape.LightEntry = false; |
3658 | } | ||
3659 | |||
3660 | if (updateFlags.HasFlag(PrimUpdateFlags.PrimFlags) || | ||
3661 | updateFlags.HasFlag(PrimUpdateFlags.ParentID) || | ||
3662 | updateFlags.HasFlag(PrimUpdateFlags.Scale) || | ||
3663 | updateFlags.HasFlag(PrimUpdateFlags.PrimData) || | ||
3664 | updateFlags.HasFlag(PrimUpdateFlags.Text) || | ||
3665 | updateFlags.HasFlag(PrimUpdateFlags.NameValue) || | ||
3666 | updateFlags.HasFlag(PrimUpdateFlags.ExtraData) || | ||
3667 | updateFlags.HasFlag(PrimUpdateFlags.TextureAnim) || | ||
3668 | updateFlags.HasFlag(PrimUpdateFlags.Sound) || | ||
3669 | updateFlags.HasFlag(PrimUpdateFlags.Particles) || | ||
3670 | updateFlags.HasFlag(PrimUpdateFlags.Material) || | ||
3671 | updateFlags.HasFlag(PrimUpdateFlags.ClickAction) || | ||
3672 | updateFlags.HasFlag(PrimUpdateFlags.MediaURL) || | ||
3673 | updateFlags.HasFlag(PrimUpdateFlags.Joint)) | ||
3674 | { | ||
3675 | canUseImproved = false; | ||
3676 | } | 3689 | } |
3677 | } | 3690 | } |
3678 | 3691 | } | |
3679 | #endregion UpdateFlags to packet type conversion | 3692 | |
3680 | 3693 | ++updatesThisCall; | |
3681 | #region Block Construction | 3694 | |
3682 | 3695 | #region UpdateFlags to packet type conversion | |
3683 | // TODO: Remove this once we can build compressed updates | 3696 | |
3697 | PrimUpdateFlags updateFlags = (PrimUpdateFlags)update.Flags; | ||
3698 | |||
3699 | bool canUseCompressed = true; | ||
3700 | bool canUseImproved = true; | ||
3701 | |||
3702 | // Compressed object updates only make sense for LL primitives | ||
3703 | if (!(update.Entity is SceneObjectPart)) | ||
3704 | { | ||
3684 | canUseCompressed = false; | 3705 | canUseCompressed = false; |
3685 | 3706 | } | |
3686 | if (!canUseImproved && !canUseCompressed) | 3707 | |
3708 | if (updateFlags.HasFlag(PrimUpdateFlags.FullUpdate)) | ||
3709 | { | ||
3710 | canUseCompressed = false; | ||
3711 | canUseImproved = false; | ||
3712 | } | ||
3713 | else | ||
3714 | { | ||
3715 | if (updateFlags.HasFlag(PrimUpdateFlags.Velocity) || | ||
3716 | updateFlags.HasFlag(PrimUpdateFlags.Acceleration) || | ||
3717 | updateFlags.HasFlag(PrimUpdateFlags.CollisionPlane) || | ||
3718 | updateFlags.HasFlag(PrimUpdateFlags.Joint)) | ||
3687 | { | 3719 | { |
3688 | if (update.Entity is ScenePresence) | 3720 | canUseCompressed = false; |
3689 | { | 3721 | } |
3690 | objectUpdateBlocks.Value.Add(CreateAvatarUpdateBlock((ScenePresence)update.Entity)); | 3722 | |
3691 | } | 3723 | if (updateFlags.HasFlag(PrimUpdateFlags.PrimFlags) || |
3692 | else | 3724 | updateFlags.HasFlag(PrimUpdateFlags.ParentID) || |
3693 | { | 3725 | updateFlags.HasFlag(PrimUpdateFlags.Scale) || |
3694 | objectUpdateBlocks.Value.Add(CreatePrimUpdateBlock((SceneObjectPart)update.Entity, this.m_agentId)); | 3726 | updateFlags.HasFlag(PrimUpdateFlags.PrimData) || |
3695 | } | 3727 | updateFlags.HasFlag(PrimUpdateFlags.Text) || |
3728 | updateFlags.HasFlag(PrimUpdateFlags.NameValue) || | ||
3729 | updateFlags.HasFlag(PrimUpdateFlags.ExtraData) || | ||
3730 | updateFlags.HasFlag(PrimUpdateFlags.TextureAnim) || | ||
3731 | updateFlags.HasFlag(PrimUpdateFlags.Sound) || | ||
3732 | updateFlags.HasFlag(PrimUpdateFlags.Particles) || | ||
3733 | updateFlags.HasFlag(PrimUpdateFlags.Material) || | ||
3734 | updateFlags.HasFlag(PrimUpdateFlags.ClickAction) || | ||
3735 | updateFlags.HasFlag(PrimUpdateFlags.MediaURL) || | ||
3736 | updateFlags.HasFlag(PrimUpdateFlags.Joint)) | ||
3737 | { | ||
3738 | canUseImproved = false; | ||
3696 | } | 3739 | } |
3697 | else if (!canUseImproved) | 3740 | } |
3741 | |||
3742 | #endregion UpdateFlags to packet type conversion | ||
3743 | |||
3744 | #region Block Construction | ||
3745 | |||
3746 | // TODO: Remove this once we can build compressed updates | ||
3747 | canUseCompressed = false; | ||
3748 | |||
3749 | if (!canUseImproved && !canUseCompressed) | ||
3750 | { | ||
3751 | if (update.Entity is ScenePresence) | ||
3698 | { | 3752 | { |
3699 | compressedUpdateBlocks.Value.Add(CreateCompressedUpdateBlock((SceneObjectPart)update.Entity, updateFlags)); | 3753 | objectUpdateBlocks.Value.Add(CreateAvatarUpdateBlock((ScenePresence)update.Entity)); |
3700 | } | 3754 | } |
3701 | else | 3755 | else |
3702 | { | 3756 | { |
3703 | if (update.Entity is ScenePresence && ((ScenePresence)update.Entity).UUID == AgentId) | 3757 | objectUpdateBlocks.Value.Add(CreatePrimUpdateBlock((SceneObjectPart)update.Entity, this.m_agentId)); |
3704 | // Self updates go into a special list | ||
3705 | terseAgentUpdateBlocks.Value.Add(CreateImprovedTerseBlock(update.Entity, updateFlags.HasFlag(PrimUpdateFlags.Textures))); | ||
3706 | else | ||
3707 | // Everything else goes here | ||
3708 | terseUpdateBlocks.Value.Add(CreateImprovedTerseBlock(update.Entity, updateFlags.HasFlag(PrimUpdateFlags.Textures))); | ||
3709 | } | 3758 | } |
3710 | |||
3711 | #endregion Block Construction | ||
3712 | } | 3759 | } |
3713 | 3760 | else if (!canUseImproved) | |
3761 | { | ||
3762 | compressedUpdateBlocks.Value.Add(CreateCompressedUpdateBlock((SceneObjectPart)update.Entity, updateFlags)); | ||
3763 | } | ||
3764 | else | ||
3765 | { | ||
3766 | if (update.Entity is ScenePresence && ((ScenePresence)update.Entity).UUID == AgentId) | ||
3767 | // Self updates go into a special list | ||
3768 | terseAgentUpdateBlocks.Value.Add(CreateImprovedTerseBlock(update.Entity, updateFlags.HasFlag(PrimUpdateFlags.Textures))); | ||
3769 | else | ||
3770 | // Everything else goes here | ||
3771 | terseUpdateBlocks.Value.Add(CreateImprovedTerseBlock(update.Entity, updateFlags.HasFlag(PrimUpdateFlags.Textures))); | ||
3772 | } | ||
3773 | |||
3774 | #endregion Block Construction | ||
3775 | } | ||
3776 | |||
3777 | #region Packet Sending | ||
3714 | 3778 | ||
3715 | #region Packet Sending | 3779 | const float TIME_DILATION = 1.0f; |
3716 | 3780 | ushort timeDilation = Utils.FloatToUInt16(avgTimeDilation, 0.0f, 1.0f); | |
3717 | //const float TIME_DILATION = 1.0f; | 3781 | |
3782 | if (terseAgentUpdateBlocks.IsValueCreated) | ||
3783 | { | ||
3784 | List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock> blocks = terseAgentUpdateBlocks.Value; | ||
3785 | |||
3786 | ImprovedTerseObjectUpdatePacket packet = new ImprovedTerseObjectUpdatePacket(); | ||
3787 | packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; | ||
3788 | packet.RegionData.TimeDilation = timeDilation; | ||
3789 | packet.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[blocks.Count]; | ||
3790 | |||
3791 | for (int i = 0; i < blocks.Count; i++) | ||
3792 | packet.ObjectData[i] = blocks[i]; | ||
3718 | 3793 | ||
3794 | OutPacket(packet, ThrottleOutPacketType.Unknown, true); | ||
3795 | } | ||
3719 | 3796 | ||
3720 | ushort timeDilation = Utils.FloatToUInt16(avgTimeDilation, 0.0f, 1.0f); | 3797 | if (objectUpdateBlocks.IsValueCreated) |
3798 | { | ||
3799 | List<ObjectUpdatePacket.ObjectDataBlock> blocks = objectUpdateBlocks.Value; | ||
3721 | 3800 | ||
3722 | if (terseAgentUpdateBlocks.IsValueCreated) | 3801 | ObjectUpdatePacket packet = (ObjectUpdatePacket)PacketPool.Instance.GetPacket(PacketType.ObjectUpdate); |
3723 | { | 3802 | packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; |
3724 | List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock> blocks = terseAgentUpdateBlocks.Value; | 3803 | packet.RegionData.TimeDilation = timeDilation; |
3804 | packet.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[blocks.Count]; | ||
3805 | |||
3806 | for (int i = 0; i < blocks.Count; i++) | ||
3807 | packet.ObjectData[i] = blocks[i]; | ||
3725 | 3808 | ||
3726 | ImprovedTerseObjectUpdatePacket packet = new ImprovedTerseObjectUpdatePacket(); | 3809 | OutPacket(packet, ThrottleOutPacketType.Task, true); |
3727 | packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; | 3810 | } |
3728 | packet.RegionData.TimeDilation = timeDilation; | 3811 | |
3729 | packet.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[blocks.Count]; | 3812 | if (compressedUpdateBlocks.IsValueCreated) |
3813 | { | ||
3814 | List<ObjectUpdateCompressedPacket.ObjectDataBlock> blocks = compressedUpdateBlocks.Value; | ||
3730 | 3815 | ||
3731 | for (int i = 0; i < blocks.Count; i++) | 3816 | ObjectUpdateCompressedPacket packet = (ObjectUpdateCompressedPacket)PacketPool.Instance.GetPacket(PacketType.ObjectUpdateCompressed); |
3732 | packet.ObjectData[i] = blocks[i]; | 3817 | packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; |
3818 | packet.RegionData.TimeDilation = timeDilation; | ||
3819 | packet.ObjectData = new ObjectUpdateCompressedPacket.ObjectDataBlock[blocks.Count]; | ||
3733 | 3820 | ||
3734 | 3821 | for (int i = 0; i < blocks.Count; i++) | |
3735 | OutPacket(packet, ThrottleOutPacketType.Unknown, true); | 3822 | packet.ObjectData[i] = blocks[i]; |
3736 | } | ||
3737 | 3823 | ||
3738 | if (objectUpdateBlocks.IsValueCreated) | 3824 | OutPacket(packet, ThrottleOutPacketType.Task, true); |
3739 | { | 3825 | } |
3740 | List<ObjectUpdatePacket.ObjectDataBlock> blocks = objectUpdateBlocks.Value; | 3826 | |
3741 | 3827 | if (terseUpdateBlocks.IsValueCreated) | |
3742 | ObjectUpdatePacket packet = (ObjectUpdatePacket)PacketPool.Instance.GetPacket(PacketType.ObjectUpdate); | 3828 | { |
3743 | packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; | 3829 | List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock> blocks = terseUpdateBlocks.Value; |
3744 | packet.RegionData.TimeDilation = timeDilation; | 3830 | |
3745 | packet.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[blocks.Count]; | 3831 | ImprovedTerseObjectUpdatePacket packet = new ImprovedTerseObjectUpdatePacket(); |
3746 | 3832 | packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; | |
3747 | for (int i = 0; i < blocks.Count; i++) | 3833 | packet.RegionData.TimeDilation = timeDilation; |
3748 | packet.ObjectData[i] = blocks[i]; | 3834 | packet.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[blocks.Count]; |
3749 | 3835 | ||
3750 | OutPacket(packet, ThrottleOutPacketType.Task, true); | 3836 | for (int i = 0; i < blocks.Count; i++) |
3751 | } | 3837 | packet.ObjectData[i] = blocks[i]; |
3752 | 3838 | ||
3753 | if (compressedUpdateBlocks.IsValueCreated) | 3839 | OutPacket(packet, ThrottleOutPacketType.Task, true); |
3754 | { | ||
3755 | List<ObjectUpdateCompressedPacket.ObjectDataBlock> blocks = compressedUpdateBlocks.Value; | ||
3756 | |||
3757 | ObjectUpdateCompressedPacket packet = (ObjectUpdateCompressedPacket)PacketPool.Instance.GetPacket(PacketType.ObjectUpdateCompressed); | ||
3758 | packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; | ||
3759 | packet.RegionData.TimeDilation = timeDilation; | ||
3760 | packet.ObjectData = new ObjectUpdateCompressedPacket.ObjectDataBlock[blocks.Count]; | ||
3761 | |||
3762 | for (int i = 0; i < blocks.Count; i++) | ||
3763 | packet.ObjectData[i] = blocks[i]; | ||
3764 | |||
3765 | OutPacket(packet, ThrottleOutPacketType.Task, true); | ||
3766 | } | ||
3767 | |||
3768 | if (terseUpdateBlocks.IsValueCreated) | ||
3769 | { | ||
3770 | List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock> blocks = terseUpdateBlocks.Value; | ||
3771 | |||
3772 | ImprovedTerseObjectUpdatePacket packet = new ImprovedTerseObjectUpdatePacket(); | ||
3773 | packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; | ||
3774 | packet.RegionData.TimeDilation = timeDilation; | ||
3775 | packet.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[blocks.Count]; | ||
3776 | |||
3777 | for (int i = 0; i < blocks.Count; i++) | ||
3778 | packet.ObjectData[i] = blocks[i]; | ||
3779 | |||
3780 | OutPacket(packet, ThrottleOutPacketType.Task, true); | ||
3781 | } | ||
3782 | } | 3840 | } |
3783 | 3841 | ||
3784 | #endregion Packet Sending | 3842 | #endregion Packet Sending |
@@ -4550,14 +4608,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4550 | 4608 | ||
4551 | if (notifyCount > 0) | 4609 | if (notifyCount > 0) |
4552 | { | 4610 | { |
4553 | if (notifyCount > 32) | 4611 | // if (notifyCount > 32) |
4554 | { | 4612 | // { |
4555 | m_log.InfoFormat( | 4613 | // m_log.InfoFormat( |
4556 | "[LAND]: More than {0} avatars own prims on this parcel. Only sending back details of first {0}" | 4614 | // "[LAND]: More than {0} avatars own prims on this parcel. Only sending back details of first {0}" |
4557 | + " - a developer might want to investigate whether this is a hard limit", 32); | 4615 | // + " - a developer might want to investigate whether this is a hard limit", 32); |
4558 | 4616 | // | |
4559 | notifyCount = 32; | 4617 | // notifyCount = 32; |
4560 | } | 4618 | // } |
4561 | 4619 | ||
4562 | ParcelObjectOwnersReplyPacket.DataBlock[] dataBlock | 4620 | ParcelObjectOwnersReplyPacket.DataBlock[] dataBlock |
4563 | = new ParcelObjectOwnersReplyPacket.DataBlock[notifyCount]; | 4621 | = new ParcelObjectOwnersReplyPacket.DataBlock[notifyCount]; |
@@ -5065,6 +5123,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
5065 | AddLocalPacketHandler(PacketType.TransferAbort, HandleTransferAbort, false); | 5123 | AddLocalPacketHandler(PacketType.TransferAbort, HandleTransferAbort, false); |
5066 | AddLocalPacketHandler(PacketType.MuteListRequest, HandleMuteListRequest, false); | 5124 | AddLocalPacketHandler(PacketType.MuteListRequest, HandleMuteListRequest, false); |
5067 | AddLocalPacketHandler(PacketType.UseCircuitCode, HandleUseCircuitCode); | 5125 | AddLocalPacketHandler(PacketType.UseCircuitCode, HandleUseCircuitCode); |
5126 | AddLocalPacketHandler(PacketType.CreateNewOutfitAttachments, HandleCreateNewOutfitAttachments); | ||
5068 | AddLocalPacketHandler(PacketType.AgentHeightWidth, HandleAgentHeightWidth, false); | 5127 | AddLocalPacketHandler(PacketType.AgentHeightWidth, HandleAgentHeightWidth, false); |
5069 | AddLocalPacketHandler(PacketType.InventoryDescendents, HandleInventoryDescendents); | 5128 | AddLocalPacketHandler(PacketType.InventoryDescendents, HandleInventoryDescendents); |
5070 | AddLocalPacketHandler(PacketType.DirPlacesQuery, HandleDirPlacesQuery); | 5129 | AddLocalPacketHandler(PacketType.DirPlacesQuery, HandleDirPlacesQuery); |
@@ -5164,6 +5223,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
5164 | (x.CameraLeftAxis != lastarg.CameraLeftAxis) || | 5223 | (x.CameraLeftAxis != lastarg.CameraLeftAxis) || |
5165 | (x.CameraUpAxis != lastarg.CameraUpAxis) || | 5224 | (x.CameraUpAxis != lastarg.CameraUpAxis) || |
5166 | (x.ControlFlags != lastarg.ControlFlags) || | 5225 | (x.ControlFlags != lastarg.ControlFlags) || |
5226 | (x.ControlFlags != 0) || | ||
5167 | (x.Far != lastarg.Far) || | 5227 | (x.Far != lastarg.Far) || |
5168 | (x.Flags != lastarg.Flags) || | 5228 | (x.Flags != lastarg.Flags) || |
5169 | (x.State != lastarg.State) || | 5229 | (x.State != lastarg.State) || |
@@ -5537,7 +5597,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
5537 | args.Channel = ch; | 5597 | args.Channel = ch; |
5538 | args.From = String.Empty; | 5598 | args.From = String.Empty; |
5539 | args.Message = Utils.BytesToString(msg); | 5599 | args.Message = Utils.BytesToString(msg); |
5540 | args.Type = ChatTypeEnum.Shout; | 5600 | args.Type = ChatTypeEnum.Region; //Behaviour in SL is that the response can be heard from any distance |
5541 | args.Position = new Vector3(); | 5601 | args.Position = new Vector3(); |
5542 | args.Scene = Scene; | 5602 | args.Scene = Scene; |
5543 | args.Sender = this; | 5603 | args.Sender = this; |
@@ -9525,7 +9585,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
9525 | handlerUpdateMuteListEntry(this, UpdateMuteListEntry.MuteData.MuteID, | 9585 | handlerUpdateMuteListEntry(this, UpdateMuteListEntry.MuteData.MuteID, |
9526 | Utils.BytesToString(UpdateMuteListEntry.MuteData.MuteName), | 9586 | Utils.BytesToString(UpdateMuteListEntry.MuteData.MuteName), |
9527 | UpdateMuteListEntry.MuteData.MuteType, | 9587 | UpdateMuteListEntry.MuteData.MuteType, |
9528 | UpdateMuteListEntry.AgentData.AgentID); | 9588 | UpdateMuteListEntry.MuteData.MuteFlags); |
9529 | return true; | 9589 | return true; |
9530 | } | 9590 | } |
9531 | return false; | 9591 | return false; |
@@ -9540,8 +9600,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
9540 | { | 9600 | { |
9541 | handlerRemoveMuteListEntry(this, | 9601 | handlerRemoveMuteListEntry(this, |
9542 | RemoveMuteListEntry.MuteData.MuteID, | 9602 | RemoveMuteListEntry.MuteData.MuteID, |
9543 | Utils.BytesToString(RemoveMuteListEntry.MuteData.MuteName), | 9603 | Utils.BytesToString(RemoveMuteListEntry.MuteData.MuteName)); |
9544 | RemoveMuteListEntry.AgentData.AgentID); | ||
9545 | return true; | 9604 | return true; |
9546 | } | 9605 | } |
9547 | return false; | 9606 | return false; |
@@ -9589,6 +9648,37 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
9589 | { | 9648 | { |
9590 | return true; | 9649 | return true; |
9591 | } | 9650 | } |
9651 | |||
9652 | private bool HandleCreateNewOutfitAttachments(IClientAPI sender, Packet Pack) | ||
9653 | { | ||
9654 | CreateNewOutfitAttachmentsPacket packet = (CreateNewOutfitAttachmentsPacket)Pack; | ||
9655 | |||
9656 | #region Packet Session and User Check | ||
9657 | if (m_checkPackets) | ||
9658 | { | ||
9659 | if (packet.AgentData.SessionID != SessionId || | ||
9660 | packet.AgentData.AgentID != AgentId) | ||
9661 | return true; | ||
9662 | } | ||
9663 | #endregion | ||
9664 | MoveItemsAndLeaveCopy handlerMoveItemsAndLeaveCopy = null; | ||
9665 | List<InventoryItemBase> items = new List<InventoryItemBase>(); | ||
9666 | foreach (CreateNewOutfitAttachmentsPacket.ObjectDataBlock n in packet.ObjectData) | ||
9667 | { | ||
9668 | InventoryItemBase b = new InventoryItemBase(); | ||
9669 | b.ID = n.OldItemID; | ||
9670 | b.Folder = n.OldFolderID; | ||
9671 | items.Add(b); | ||
9672 | } | ||
9673 | |||
9674 | handlerMoveItemsAndLeaveCopy = OnMoveItemsAndLeaveCopy; | ||
9675 | if (handlerMoveItemsAndLeaveCopy != null) | ||
9676 | { | ||
9677 | handlerMoveItemsAndLeaveCopy(this, items, packet.HeaderData.NewFolderID); | ||
9678 | } | ||
9679 | |||
9680 | return true; | ||
9681 | } | ||
9592 | 9682 | ||
9593 | private bool HandleAgentHeightWidth(IClientAPI sender, Packet Pack) | 9683 | private bool HandleAgentHeightWidth(IClientAPI sender, Packet Pack) |
9594 | { | 9684 | { |
@@ -10015,6 +10105,20 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
10015 | groupProfileReply.GroupData.MaturePublish = d.MaturePublish; | 10105 | groupProfileReply.GroupData.MaturePublish = d.MaturePublish; |
10016 | groupProfileReply.GroupData.OwnerRole = d.OwnerRole; | 10106 | groupProfileReply.GroupData.OwnerRole = d.OwnerRole; |
10017 | 10107 | ||
10108 | Scene scene = (Scene)m_scene; | ||
10109 | if (scene.Permissions.IsGod(sender.AgentId) && (!sender.IsGroupMember(groupProfileRequest.GroupData.GroupID))) | ||
10110 | { | ||
10111 | ScenePresence p; | ||
10112 | if (scene.TryGetScenePresence(sender.AgentId, out p)) | ||
10113 | { | ||
10114 | if (p.GodLevel >= 200) | ||
10115 | { | ||
10116 | groupProfileReply.GroupData.OpenEnrollment = true; | ||
10117 | groupProfileReply.GroupData.MembershipFee = 0; | ||
10118 | } | ||
10119 | } | ||
10120 | } | ||
10121 | |||
10018 | OutPacket(groupProfileReply, ThrottleOutPacketType.Task); | 10122 | OutPacket(groupProfileReply, ThrottleOutPacketType.Task); |
10019 | } | 10123 | } |
10020 | return true; | 10124 | return true; |
@@ -10587,11 +10691,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
10587 | 10691 | ||
10588 | StartLure handlerStartLure = OnStartLure; | 10692 | StartLure handlerStartLure = OnStartLure; |
10589 | if (handlerStartLure != null) | 10693 | if (handlerStartLure != null) |
10590 | handlerStartLure(startLureRequest.Info.LureType, | 10694 | { |
10591 | Utils.BytesToString( | 10695 | for (int i = 0 ; i < startLureRequest.TargetData.Length ; i++) |
10592 | startLureRequest.Info.Message), | 10696 | { |
10593 | startLureRequest.TargetData[0].TargetID, | 10697 | handlerStartLure(startLureRequest.Info.LureType, |
10594 | this); | 10698 | Utils.BytesToString( |
10699 | startLureRequest.Info.Message), | ||
10700 | startLureRequest.TargetData[i].TargetID, | ||
10701 | this); | ||
10702 | } | ||
10703 | } | ||
10595 | return true; | 10704 | return true; |
10596 | } | 10705 | } |
10597 | private bool HandleTeleportLureRequest(IClientAPI sender, Packet Pack) | 10706 | private bool HandleTeleportLureRequest(IClientAPI sender, Packet Pack) |
@@ -10705,10 +10814,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
10705 | } | 10814 | } |
10706 | #endregion | 10815 | #endregion |
10707 | 10816 | ||
10708 | ClassifiedDelete handlerClassifiedGodDelete = OnClassifiedGodDelete; | 10817 | ClassifiedGodDelete handlerClassifiedGodDelete = OnClassifiedGodDelete; |
10709 | if (handlerClassifiedGodDelete != null) | 10818 | if (handlerClassifiedGodDelete != null) |
10710 | handlerClassifiedGodDelete( | 10819 | handlerClassifiedGodDelete( |
10711 | classifiedGodDelete.Data.ClassifiedID, | 10820 | classifiedGodDelete.Data.ClassifiedID, |
10821 | classifiedGodDelete.Data.QueryID, | ||
10712 | this); | 10822 | this); |
10713 | return true; | 10823 | return true; |
10714 | } | 10824 | } |
@@ -11086,7 +11196,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11086 | { | 11196 | { |
11087 | // It's a ghost! tell the client to delete it from view. | 11197 | // It's a ghost! tell the client to delete it from view. |
11088 | simClient.SendKillObject(Scene.RegionInfo.RegionHandle, | 11198 | simClient.SendKillObject(Scene.RegionInfo.RegionHandle, |
11089 | localId); | 11199 | new List<uint>() { localId }); |
11090 | } | 11200 | } |
11091 | else | 11201 | else |
11092 | { | 11202 | { |
@@ -11459,22 +11569,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11459 | /// <param name="Pack">OpenMetaverse.packet</param> | 11569 | /// <param name="Pack">OpenMetaverse.packet</param> |
11460 | public void ProcessInPacket(Packet packet) | 11570 | public void ProcessInPacket(Packet packet) |
11461 | { | 11571 | { |
11462 | if (m_debugPacketLevel > 0) | 11572 | if (m_debugPacketLevel >= 255) |
11463 | { | 11573 | m_log.DebugFormat("[CLIENT]: Packet IN {0}", packet.Type); |
11464 | bool outputPacket = true; | ||
11465 | |||
11466 | if (m_debugPacketLevel <= 255 && packet.Type == PacketType.AgentUpdate) | ||
11467 | outputPacket = false; | ||
11468 | |||
11469 | if (m_debugPacketLevel <= 200 && packet.Type == PacketType.RequestImage) | ||
11470 | outputPacket = false; | ||
11471 | |||
11472 | if (m_debugPacketLevel <= 100 && (packet.Type == PacketType.ViewerEffect || packet.Type == PacketType.AgentAnimation)) | ||
11473 | outputPacket = false; | ||
11474 | |||
11475 | if (outputPacket) | ||
11476 | m_log.DebugFormat("[CLIENT]: Packet IN {0}", packet.Type); | ||
11477 | } | ||
11478 | 11574 | ||
11479 | if (!ProcessPacketMethod(packet)) | 11575 | if (!ProcessPacketMethod(packet)) |
11480 | m_log.Warn("[CLIENT]: unhandled packet " + packet.Type); | 11576 | m_log.Warn("[CLIENT]: unhandled packet " + packet.Type); |
@@ -11716,7 +11812,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11716 | 11812 | ||
11717 | // m_log.DebugFormat("[CLIENT]: {0} requesting asset {1}", Name, requestID); | 11813 | // m_log.DebugFormat("[CLIENT]: {0} requesting asset {1}", Name, requestID); |
11718 | 11814 | ||
11815 | |||
11816 | //Note, the bool returned from the below function is useless since it is always false. | ||
11719 | m_assetService.Get(requestID.ToString(), transferRequest, AssetReceived); | 11817 | m_assetService.Get(requestID.ToString(), transferRequest, AssetReceived); |
11818 | |||
11720 | } | 11819 | } |
11721 | 11820 | ||
11722 | /// <summary> | 11821 | /// <summary> |