diff options
author | Adam Johnson | 2007-12-28 08:51:39 +0000 |
---|---|---|
committer | Adam Johnson | 2007-12-28 08:51:39 +0000 |
commit | 79496381fc68cbd30ff5a95d1f05fcb18c6b1a93 (patch) | |
tree | 036414391293354da62fe9eac1895483111480a3 /OpenSim/Region/Environment/LandManagement | |
parent | * Moved PrimitiveBaseShape subclasses into factory methods - the subclassing ... (diff) | |
download | opensim-SC-79496381fc68cbd30ff5a95d1f05fcb18c6b1a93.zip opensim-SC-79496381fc68cbd30ff5a95d1f05fcb18c6b1a93.tar.gz opensim-SC-79496381fc68cbd30ff5a95d1f05fcb18c6b1a93.tar.bz2 opensim-SC-79496381fc68cbd30ff5a95d1f05fcb18c6b1a93.tar.xz |
Patch from Johan: LibSL updated to the latest revision (1568) and all packets are now
recycled to improve performance and memory usage.
Diffstat (limited to 'OpenSim/Region/Environment/LandManagement')
-rw-r--r-- | OpenSim/Region/Environment/LandManagement/Land.cs | 19 | ||||
-rw-r--r-- | OpenSim/Region/Environment/LandManagement/LandManager.cs | 5 |
2 files changed, 15 insertions, 9 deletions
diff --git a/OpenSim/Region/Environment/LandManagement/Land.cs b/OpenSim/Region/Environment/LandManagement/Land.cs index ff16319..5c99ffd 100644 --- a/OpenSim/Region/Environment/LandManagement/Land.cs +++ b/OpenSim/Region/Environment/LandManagement/Land.cs | |||
@@ -32,6 +32,7 @@ using libsecondlife; | |||
32 | using libsecondlife.Packets; | 32 | using libsecondlife.Packets; |
33 | using OpenSim.Framework; | 33 | using OpenSim.Framework; |
34 | using OpenSim.Region.Environment.Scenes; | 34 | using OpenSim.Region.Environment.Scenes; |
35 | using OpenSim.Region.Environment.Interfaces; | ||
35 | 36 | ||
36 | namespace OpenSim.Region.Environment.LandManagement | 37 | namespace OpenSim.Region.Environment.LandManagement |
37 | { | 38 | { |
@@ -110,7 +111,9 @@ namespace OpenSim.Region.Environment.LandManagement | |||
110 | public void sendLandProperties(int sequence_id, bool snap_selection, int request_result, | 111 | public void sendLandProperties(int sequence_id, bool snap_selection, int request_result, |
111 | IClientAPI remote_client) | 112 | IClientAPI remote_client) |
112 | { | 113 | { |
113 | ParcelPropertiesPacket updatePacket = new ParcelPropertiesPacket(); | 114 | ParcelPropertiesPacket updatePacket = (ParcelPropertiesPacket) PacketPool.Instance.GetPacket(PacketType.ParcelProperties); |
115 | // TODO: don't create new blocks if recycling an old packet | ||
116 | |||
114 | updatePacket.ParcelData.AABBMax = landData.AABBMax; | 117 | updatePacket.ParcelData.AABBMax = landData.AABBMax; |
115 | updatePacket.ParcelData.AABBMin = landData.AABBMin; | 118 | updatePacket.ParcelData.AABBMin = landData.AABBMin; |
116 | updatePacket.ParcelData.Area = landData.area; | 119 | updatePacket.ParcelData.Area = landData.area; |
@@ -334,7 +337,7 @@ namespace OpenSim.Region.Environment.LandManagement | |||
334 | 337 | ||
335 | if (flags == (uint) ParcelManager.AccessList.Access || flags == (uint) ParcelManager.AccessList.Both) | 338 | if (flags == (uint) ParcelManager.AccessList.Access || flags == (uint) ParcelManager.AccessList.Both) |
336 | { | 339 | { |
337 | replyPacket = new ParcelAccessListReplyPacket(); | 340 | replyPacket = (ParcelAccessListReplyPacket) PacketPool.Instance.GetPacket(PacketType.ParcelAccessListReply); |
338 | replyPacket.Data.AgentID = agentID; | 341 | replyPacket.Data.AgentID = agentID; |
339 | replyPacket.Data.Flags = (uint) ParcelManager.AccessList.Access; | 342 | replyPacket.Data.Flags = (uint) ParcelManager.AccessList.Access; |
340 | replyPacket.Data.LocalID = landData.localID; | 343 | replyPacket.Data.LocalID = landData.localID; |
@@ -346,7 +349,7 @@ namespace OpenSim.Region.Environment.LandManagement | |||
346 | 349 | ||
347 | if (flags == (uint) ParcelManager.AccessList.Ban || flags == (uint) ParcelManager.AccessList.Both) | 350 | if (flags == (uint) ParcelManager.AccessList.Ban || flags == (uint) ParcelManager.AccessList.Both) |
348 | { | 351 | { |
349 | replyPacket = new ParcelAccessListReplyPacket(); | 352 | replyPacket = (ParcelAccessListReplyPacket) PacketPool.Instance.GetPacket(PacketType.ParcelAccessListReply); |
350 | replyPacket.Data.AgentID = agentID; | 353 | replyPacket.Data.AgentID = agentID; |
351 | replyPacket.Data.Flags = (uint) ParcelManager.AccessList.Ban; | 354 | replyPacket.Data.Flags = (uint) ParcelManager.AccessList.Ban; |
352 | replyPacket.Data.LocalID = landData.localID; | 355 | replyPacket.Data.LocalID = landData.localID; |
@@ -657,7 +660,8 @@ namespace OpenSim.Region.Environment.LandManagement | |||
657 | 660 | ||
658 | bool firstCall = true; | 661 | bool firstCall = true; |
659 | int MAX_OBJECTS_PER_PACKET = 251; | 662 | int MAX_OBJECTS_PER_PACKET = 251; |
660 | ForceObjectSelectPacket pack = new ForceObjectSelectPacket(); | 663 | ForceObjectSelectPacket pack = (ForceObjectSelectPacket) PacketPool.Instance.GetPacket(PacketType.ForceObjectSelect); |
664 | // TODO: don't create new blocks if recycling an old packet | ||
661 | ForceObjectSelectPacket.DataBlock[] data; | 665 | ForceObjectSelectPacket.DataBlock[] data; |
662 | while (resultLocalIDs.Count > 0) | 666 | while (resultLocalIDs.Count > 0) |
663 | { | 667 | { |
@@ -695,7 +699,9 @@ namespace OpenSim.Region.Environment.LandManagement | |||
695 | public void sendLandObjectOwners(IClientAPI remote_client) | 699 | public void sendLandObjectOwners(IClientAPI remote_client) |
696 | { | 700 | { |
697 | Dictionary<LLUUID, int> ownersAndCount = new Dictionary<LLUUID, int>(); | 701 | Dictionary<LLUUID, int> ownersAndCount = new Dictionary<LLUUID, int>(); |
698 | ParcelObjectOwnersReplyPacket pack = new ParcelObjectOwnersReplyPacket(); | 702 | ParcelObjectOwnersReplyPacket pack = (ParcelObjectOwnersReplyPacket) PacketPool.Instance.GetPacket(PacketType.ParcelObjectOwnersReply); |
703 | // TODO: don't create new blocks if recycling an old packet | ||
704 | |||
699 | foreach (SceneObjectGroup obj in primsOverMe) | 705 | foreach (SceneObjectGroup obj in primsOverMe) |
700 | { | 706 | { |
701 | if (!ownersAndCount.ContainsKey(obj.OwnerID)) | 707 | if (!ownersAndCount.ContainsKey(obj.OwnerID)) |
@@ -725,7 +731,6 @@ namespace OpenSim.Region.Environment.LandManagement | |||
725 | 731 | ||
726 | num++; | 732 | num++; |
727 | } | 733 | } |
728 | |||
729 | pack.Data = dataBlock; | 734 | pack.Data = dataBlock; |
730 | } | 735 | } |
731 | remote_client.OutPacket(pack, ThrottleOutPacketType.Task); | 736 | remote_client.OutPacket(pack, ThrottleOutPacketType.Task); |
@@ -810,4 +815,4 @@ namespace OpenSim.Region.Environment.LandManagement | |||
810 | } | 815 | } |
811 | 816 | ||
812 | #endregion | 817 | #endregion |
813 | } \ No newline at end of file | 818 | } |
diff --git a/OpenSim/Region/Environment/LandManagement/LandManager.cs b/OpenSim/Region/Environment/LandManagement/LandManager.cs index 772fe2e..22e7fc9 100644 --- a/OpenSim/Region/Environment/LandManagement/LandManager.cs +++ b/OpenSim/Region/Environment/LandManagement/LandManager.cs | |||
@@ -33,6 +33,7 @@ using libsecondlife.Packets; | |||
33 | using OpenSim.Framework; | 33 | using OpenSim.Framework; |
34 | using OpenSim.Framework.Console; | 34 | using OpenSim.Framework.Console; |
35 | using OpenSim.Region.Environment.Scenes; | 35 | using OpenSim.Region.Environment.Scenes; |
36 | using OpenSim.Region.Environment.Interfaces; | ||
36 | using OpenSim.Region.Physics.Manager; | 37 | using OpenSim.Region.Physics.Manager; |
37 | 38 | ||
38 | namespace OpenSim.Region.Environment.LandManagement | 39 | namespace OpenSim.Region.Environment.LandManagement |
@@ -493,7 +494,7 @@ namespace OpenSim.Region.Environment.LandManagement | |||
493 | if (byteArrayCount >= LAND_BLOCKS_PER_PACKET) | 494 | if (byteArrayCount >= LAND_BLOCKS_PER_PACKET) |
494 | { | 495 | { |
495 | byteArrayCount = 0; | 496 | byteArrayCount = 0; |
496 | packet = new ParcelOverlayPacket(); | 497 | packet = (ParcelOverlayPacket) PacketPool.Instance.GetPacket(PacketType.ParcelOverlay); |
497 | packet.ParcelData.Data = byteArray; | 498 | packet.ParcelData.Data = byteArray; |
498 | packet.ParcelData.SequenceID = sequenceID; | 499 | packet.ParcelData.SequenceID = sequenceID; |
499 | remote_client.OutPacket((Packet) packet, ThrottleOutPacketType.Task); | 500 | remote_client.OutPacket((Packet) packet, ThrottleOutPacketType.Task); |
@@ -856,4 +857,4 @@ namespace OpenSim.Region.Environment.LandManagement | |||
856 | } | 857 | } |
857 | 858 | ||
858 | #endregion | 859 | #endregion |
859 | } \ No newline at end of file | 860 | } |