From c72f78215bb3435ee2bbb507746c23eccec4dd34 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Wed, 4 Nov 2009 01:56:19 +0000
Subject: Backport the fixes to WebFetchInventoryDescendents to the UDP
InventoryDescendents packet. Testing has shown that UDP inventory now works
flawlessly and, unlike CAPS inventory, doesn't download the entire agent
inventory on start. Neither does it incessantly re-request folder NULL_KEY.
Therefore, I have disabled CAPS inventory.
---
.../Region/ClientStack/LindenUDP/LLClientView.cs | 246 ++++++++-------------
.../Region/Examples/SimpleModule/MyNpcCharacter.cs | 1 +
OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 8 +-
.../Framework/Scenes/Scene.PacketHandlers.cs | 2 +-
.../Server/IRCClientView.cs | 2 +-
.../Region/OptionalModules/World/NPC/NPCAvatar.cs | 1 +
6 files changed, 105 insertions(+), 155 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index db0c3b8..bd5df19 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -1251,7 +1251,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// Do we need to send folder information?
/// Do we need to send item information?
public void SendInventoryFolderDetails(UUID ownerID, UUID folderID, List items,
- List folders,
+ List folders, int version,
bool fetchFolders, bool fetchItems)
{
// An inventory descendents packet consists of a single agent section and an inventory details
@@ -1266,172 +1266,104 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// 6 to 7 items at a time, so let's stick with 6
int MAX_ITEMS_PER_PACKET = 6;
- //Ckrinke This variable is not used, so comment out to remove the warning from the compiler (3-21-08)
- //Ckrinke uint FULL_MASK_PERMISSIONS = 2147483647;
-
+ int totalItems = fetchItems ? items.Count : 0;
+ int totalFolders = fetchFolders ? folders.Count : 0;
int itemsSent = 0;
- if (fetchItems)
- {
- InventoryDescendentsPacket descend = CreateInventoryDescendentsPacket(ownerID, folderID);
-
- if (items.Count < MAX_ITEMS_PER_PACKET)
- {
- descend.ItemData = new InventoryDescendentsPacket.ItemDataBlock[items.Count];
- }
- else
- {
- descend.ItemData = new InventoryDescendentsPacket.ItemDataBlock[MAX_ITEMS_PER_PACKET];
- }
+ int foldersSent = 0;
+ int foldersToSend = 0;
+ int itemsToSend = 0;
- // Descendents must contain the *total* number of descendents (plus folders, whether we
- // fetch them or not), not the number of entries we send in this packet. For consistency,
- // I'll use it for folder-requests, too, although I wasn't able to get one with
- // FetchFolders = true.
- // TODO this should be checked with FetchFolders = true
- descend.AgentData.Descendents = items.Count + folders.Count;
+ InventoryDescendentsPacket currentPacket = null;
- int count = 0;
- int i = 0;
- foreach (InventoryItemBase item in items)
+ // Handle empty folders
+ //
+ if (totalItems == 0 && totalFolders == 0)
+ currentPacket = CreateInventoryDescendentsPacket(ownerID, folderID, version, 0, 0);
+
+ // To preserve SL compatibility, we will NOT combine folders and items in one packet
+ //
+ while(itemsSent < totalItems || foldersSent < totalFolders)
+ {
+ if (currentPacket == null) // Start a new packet
{
- descend.ItemData[i] = new InventoryDescendentsPacket.ItemDataBlock();
- descend.ItemData[i].ItemID = item.ID;
- descend.ItemData[i].AssetID = item.AssetID;
- descend.ItemData[i].CreatorID = item.CreatorIdAsUuid;
- descend.ItemData[i].BaseMask = item.BasePermissions;
- descend.ItemData[i].Description = Util.StringToBytes256(item.Description);
- descend.ItemData[i].EveryoneMask = item.EveryOnePermissions;
- descend.ItemData[i].OwnerMask = item.CurrentPermissions;
- descend.ItemData[i].FolderID = item.Folder;
- descend.ItemData[i].InvType = (sbyte)item.InvType;
- descend.ItemData[i].Name = Util.StringToBytes256(item.Name);
- descend.ItemData[i].NextOwnerMask = item.NextPermissions;
- descend.ItemData[i].OwnerID = item.Owner;
- descend.ItemData[i].Type = (sbyte)item.AssetType;
-
- descend.ItemData[i].GroupID = item.GroupID;
- descend.ItemData[i].GroupOwned = item.GroupOwned;
- descend.ItemData[i].GroupMask = item.GroupPermissions;
- descend.ItemData[i].CreationDate = item.CreationDate;
- descend.ItemData[i].SalePrice = item.SalePrice;
- descend.ItemData[i].SaleType = item.SaleType;
- descend.ItemData[i].Flags = item.Flags;
-
- descend.ItemData[i].CRC =
- Helpers.InventoryCRC(descend.ItemData[i].CreationDate, descend.ItemData[i].SaleType,
- descend.ItemData[i].InvType, descend.ItemData[i].Type,
- descend.ItemData[i].AssetID, descend.ItemData[i].GroupID,
- descend.ItemData[i].SalePrice,
- descend.ItemData[i].OwnerID, descend.ItemData[i].CreatorID,
- descend.ItemData[i].ItemID, descend.ItemData[i].FolderID,
- descend.ItemData[i].EveryoneMask,
- descend.ItemData[i].Flags, descend.ItemData[i].OwnerMask,
- descend.ItemData[i].GroupMask, item.CurrentPermissions);
-
- i++;
- count++;
- itemsSent++;
- if (i == MAX_ITEMS_PER_PACKET)
- {
- descend.Header.Zerocoded = true;
- AddNullFolderBlockToDecendentsPacket(ref descend);
- OutPacket(descend, ThrottleOutPacketType.Asset);
-
- if ((items.Count - count) > 0)
- {
- descend = CreateInventoryDescendentsPacket(ownerID, folderID);
- if ((items.Count - count) < MAX_ITEMS_PER_PACKET)
- {
- descend.ItemData = new InventoryDescendentsPacket.ItemDataBlock[items.Count - count];
- }
- else
- {
- descend.ItemData = new InventoryDescendentsPacket.ItemDataBlock[MAX_ITEMS_PER_PACKET];
- }
- descend.AgentData.Descendents = items.Count + folders.Count;
- i = 0;
- }
+ foldersToSend = totalFolders - foldersSent;
+ if (foldersToSend > MAX_ITEMS_PER_PACKET)
+ foldersToSend = MAX_ITEMS_PER_PACKET;
+
+ if (foldersToSend == 0)
+ {
+ itemsToSend = totalItems - itemsSent;
+ if (itemsToSend > MAX_ITEMS_PER_PACKET)
+ itemsToSend = MAX_ITEMS_PER_PACKET;
}
- }
- if (0 < i && i < MAX_ITEMS_PER_PACKET)
- {
- AddNullFolderBlockToDecendentsPacket(ref descend);
- OutPacket(descend, ThrottleOutPacketType.Asset);
+ currentPacket = CreateInventoryDescendentsPacket(ownerID, folderID, version, foldersToSend, itemsToSend);
}
- }
-
- //send subfolders
- if (fetchFolders)
- {
- InventoryDescendentsPacket descend = CreateInventoryDescendentsPacket(ownerID, folderID);
- if (folders.Count < MAX_ITEMS_PER_PACKET)
- {
- descend.FolderData = new InventoryDescendentsPacket.FolderDataBlock[folders.Count];
- }
+ if (foldersToSend-- > 0)
+ currentPacket.FolderData[foldersSent % MAX_ITEMS_PER_PACKET] = CreateFolderDataBlock(folders[foldersSent++]);
+ else if(itemsToSend-- > 0)
+ currentPacket.ItemData[itemsSent % MAX_ITEMS_PER_PACKET] = CreateItemDataBlock(items[itemsSent++]);
else
{
- descend.FolderData = new InventoryDescendentsPacket.FolderDataBlock[MAX_ITEMS_PER_PACKET];
+ OutPacket(currentPacket, ThrottleOutPacketType.Asset);
+ currentPacket = null;
}
- // Not sure if this scenario ever actually occurs, but nonetheless we include the items
- // count even if we're not sending item data for the same reasons as above.
- descend.AgentData.Descendents = items.Count + folders.Count;
+ }
- int i = 0;
- int count = 0;
- foreach (InventoryFolderBase folder in folders)
- {
- descend.FolderData[i] = new InventoryDescendentsPacket.FolderDataBlock();
- descend.FolderData[i].FolderID = folder.ID;
- descend.FolderData[i].Name = Util.StringToBytes256(folder.Name);
- descend.FolderData[i].ParentID = folder.ParentID;
- descend.FolderData[i].Type = (sbyte)folder.Type;
+ if (currentPacket != null)
+ OutPacket(currentPacket, ThrottleOutPacketType.Asset);
+ }
- i++;
- count++;
- itemsSent++;
- if (i == MAX_ITEMS_PER_PACKET)
- {
- AddNullItemBlockToDescendentsPacket(ref descend);
- OutPacket(descend, ThrottleOutPacketType.Asset);
+ private InventoryDescendentsPacket.FolderDataBlock CreateFolderDataBlock(InventoryFolderBase folder)
+ {
+ InventoryDescendentsPacket.FolderDataBlock newBlock = new InventoryDescendentsPacket.FolderDataBlock();
+ newBlock.FolderID = folder.ID;
+ newBlock.Name = Util.StringToBytes256(folder.Name);
+ newBlock.ParentID = folder.ParentID;
+ newBlock.Type = (sbyte)folder.Type;
- if ((folders.Count - count) > 0)
- {
- descend = CreateInventoryDescendentsPacket(ownerID, folderID);
- if ((folders.Count - count) < MAX_ITEMS_PER_PACKET)
- {
- descend.FolderData =
- new InventoryDescendentsPacket.FolderDataBlock[folders.Count - count];
- }
- else
- {
- descend.FolderData =
- new InventoryDescendentsPacket.FolderDataBlock[MAX_ITEMS_PER_PACKET];
- }
- descend.AgentData.Descendents = items.Count + folders.Count;
- i = 0;
- }
- }
- }
+ return newBlock;
+ }
- if (0 < i && i < MAX_ITEMS_PER_PACKET)
- {
- AddNullItemBlockToDescendentsPacket(ref descend);
- OutPacket(descend, ThrottleOutPacketType.Asset);
- }
- }
+ private InventoryDescendentsPacket.ItemDataBlock CreateItemDataBlock(InventoryItemBase item)
+ {
+ InventoryDescendentsPacket.ItemDataBlock newBlock = new InventoryDescendentsPacket.ItemDataBlock();
+ newBlock.ItemID = item.ID;
+ newBlock.AssetID = item.AssetID;
+ newBlock.CreatorID = item.CreatorIdAsUuid;
+ newBlock.BaseMask = item.BasePermissions;
+ newBlock.Description = Util.StringToBytes256(item.Description);
+ newBlock.EveryoneMask = item.EveryOnePermissions;
+ newBlock.OwnerMask = item.CurrentPermissions;
+ newBlock.FolderID = item.Folder;
+ newBlock.InvType = (sbyte)item.InvType;
+ newBlock.Name = Util.StringToBytes256(item.Name);
+ newBlock.NextOwnerMask = item.NextPermissions;
+ newBlock.OwnerID = item.Owner;
+ newBlock.Type = (sbyte)item.AssetType;
- if (itemsSent == 0)
- {
- // no items found.
- InventoryDescendentsPacket descend = CreateInventoryDescendentsPacket(ownerID, folderID);
- descend.AgentData.Descendents = 0;
- AddNullItemBlockToDescendentsPacket(ref descend);
- AddNullFolderBlockToDecendentsPacket(ref descend);
- OutPacket(descend, ThrottleOutPacketType.Asset);
- }
+ newBlock.GroupID = item.GroupID;
+ newBlock.GroupOwned = item.GroupOwned;
+ newBlock.GroupMask = item.GroupPermissions;
+ newBlock.CreationDate = item.CreationDate;
+ newBlock.SalePrice = item.SalePrice;
+ newBlock.SaleType = item.SaleType;
+ newBlock.Flags = item.Flags;
+
+ newBlock.CRC =
+ Helpers.InventoryCRC(newBlock.CreationDate, newBlock.SaleType,
+ newBlock.InvType, newBlock.Type,
+ newBlock.AssetID, newBlock.GroupID,
+ newBlock.SalePrice,
+ newBlock.OwnerID, newBlock.CreatorID,
+ newBlock.ItemID, newBlock.FolderID,
+ newBlock.EveryoneMask,
+ newBlock.Flags, newBlock.OwnerMask,
+ newBlock.GroupMask, newBlock.NextOwnerMask);
+
+ return newBlock;
}
private void AddNullFolderBlockToDecendentsPacket(ref InventoryDescendentsPacket packet)
@@ -1473,14 +1405,24 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// No need to add CRC
}
- private InventoryDescendentsPacket CreateInventoryDescendentsPacket(UUID ownerID, UUID folderID)
+ private InventoryDescendentsPacket CreateInventoryDescendentsPacket(UUID ownerID, UUID folderID, int version, int folders, int items)
{
InventoryDescendentsPacket descend = (InventoryDescendentsPacket)PacketPool.Instance.GetPacket(PacketType.InventoryDescendents);
descend.Header.Zerocoded = true;
descend.AgentData.AgentID = AgentId;
descend.AgentData.OwnerID = ownerID;
descend.AgentData.FolderID = folderID;
- descend.AgentData.Version = 1;
+ descend.AgentData.Version = version;
+
+ if (folders > 0)
+ descend.FolderData = new InventoryDescendentsPacket.FolderDataBlock[folders];
+ else
+ AddNullFolderBlockToDecendentsPacket(ref descend);
+
+ if (items > 0)
+ descend.ItemData = new InventoryDescendentsPacket.ItemDataBlock[items];
+ else
+ AddNullItemBlockToDescendentsPacket(ref descend);
return descend;
}
diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
index 5a5fcfe..5891c7e 100644
--- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
+++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
@@ -538,6 +538,7 @@ namespace OpenSim.Region.Examples.SimpleModule
public virtual void SendInventoryFolderDetails(UUID ownerID, UUID folderID,
List items,
List folders,
+ int version,
bool fetchFolders,
bool fetchItems)
{
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 4d76b4ef..00743fc 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -1175,7 +1175,13 @@ namespace OpenSim.Region.Framework.Scenes
{
m_log.DebugFormat("[AGENT INVENTORY]: Send Inventory Folder {0} Update to {1} {2}", folder.Name, client.FirstName, client.LastName);
InventoryCollection contents = InventoryService.GetFolderContent(client.AgentId, folder.ID);
- client.SendInventoryFolderDetails(client.AgentId, folder.ID, contents.Items, contents.Folders, fetchFolders, fetchItems);
+ InventoryFolderBase containingFolder = new InventoryFolderBase();
+ containingFolder.ID = folder.ID;
+ containingFolder.Owner = client.AgentId;
+ containingFolder = InventoryService.GetFolder(containingFolder);
+ int version = containingFolder.Version;
+
+ client.SendInventoryFolderDetails(client.AgentId, folder.ID, contents.Items, contents.Folders, version, fetchFolders, fetchItems);
}
///
diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
index 1a91f0c..47fbeb4 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
@@ -462,7 +462,7 @@ namespace OpenSim.Region.Framework.Scenes
{
remoteClient.SendInventoryFolderDetails(
fold.Owner, folderID, fold.RequestListOfItems(),
- fold.RequestListOfFolders(), fetchFolders, fetchItems);
+ fold.RequestListOfFolders(), fold.Version, fetchFolders, fetchItems);
return;
}
diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
index 4b0d01a..f1bd705 100644
--- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
+++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
@@ -1055,7 +1055,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
}
- public void SendInventoryFolderDetails(UUID ownerID, UUID folderID, List items, List folders, bool fetchFolders, bool fetchItems)
+ public void SendInventoryFolderDetails(UUID ownerID, UUID folderID, List items, List folders, int version, bool fetchFolders, bool fetchItems)
{
}
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
index f7cadaa..cf81198 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
@@ -627,6 +627,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
public virtual void SendInventoryFolderDetails(UUID ownerID, UUID folderID,
List items,
List folders,
+ int version,
bool fetchFolders,
bool fetchItems)
{
--
cgit v1.1
From 4d2ecd1236f36e0ce6307689cac6e35baed3b73b Mon Sep 17 00:00:00 2001
From: Melanie
Date: Wed, 4 Nov 2009 03:07:21 +0000
Subject: Correctly set the totall number of descendents in inventory retrieval
---
OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index bd5df19..479da6d 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -1278,7 +1278,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// Handle empty folders
//
if (totalItems == 0 && totalFolders == 0)
- currentPacket = CreateInventoryDescendentsPacket(ownerID, folderID, version, 0, 0);
+ currentPacket = CreateInventoryDescendentsPacket(ownerID, folderID, version, items.Count + folders.Count, 0, 0);
// To preserve SL compatibility, we will NOT combine folders and items in one packet
//
@@ -1297,7 +1297,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
itemsToSend = MAX_ITEMS_PER_PACKET;
}
- currentPacket = CreateInventoryDescendentsPacket(ownerID, folderID, version, foldersToSend, itemsToSend);
+ currentPacket = CreateInventoryDescendentsPacket(ownerID, folderID, version, items.Count + folders.Count, foldersToSend, itemsToSend);
}
if (foldersToSend-- > 0)
@@ -1405,7 +1405,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// No need to add CRC
}
- private InventoryDescendentsPacket CreateInventoryDescendentsPacket(UUID ownerID, UUID folderID, int version, int folders, int items)
+ private InventoryDescendentsPacket CreateInventoryDescendentsPacket(UUID ownerID, UUID folderID, int version, int descendents, int folders, int items)
{
InventoryDescendentsPacket descend = (InventoryDescendentsPacket)PacketPool.Instance.GetPacket(PacketType.InventoryDescendents);
descend.Header.Zerocoded = true;
@@ -1413,6 +1413,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
descend.AgentData.OwnerID = ownerID;
descend.AgentData.FolderID = folderID;
descend.AgentData.Version = version;
+ descend.AgentData.Descendents = descendents;
if (folders > 0)
descend.FolderData = new InventoryDescendentsPacket.FolderDataBlock[folders];
--
cgit v1.1
From 5bcc02c97b78f76a274440ca0b62830d820299d9 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Wed, 4 Nov 2009 03:56:31 +0000
Subject: Prevent autosplitting of inventory descendents packets. Also reduces
the number of items per packet to 5 to prevent asserts
---
OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index 479da6d..e26d50a 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -1264,7 +1264,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
//
// for one example of this kind of thing. In fact, the Linden servers appear to only send about
// 6 to 7 items at a time, so let's stick with 6
- int MAX_ITEMS_PER_PACKET = 6;
+ int MAX_ITEMS_PER_PACKET = 5;
int totalItems = fetchItems ? items.Count : 0;
int totalFolders = fetchFolders ? folders.Count : 0;
@@ -1415,6 +1415,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
descend.AgentData.Version = version;
descend.AgentData.Descendents = descendents;
+ // Disable multiple packets
+ descend.HasVariableBlocks = false;
+
if (folders > 0)
descend.FolderData = new InventoryDescendentsPacket.FolderDataBlock[folders];
else
--
cgit v1.1
From cfcb5faa4e7ff48b486567c32e07253fabdbc8ec Mon Sep 17 00:00:00 2001
From: Melanie
Date: Wed, 4 Nov 2009 04:09:46 +0000
Subject: Bounce the pacjet items limit back up to 6
---
OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index e26d50a..09c5dfa 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -1264,7 +1264,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
//
// for one example of this kind of thing. In fact, the Linden servers appear to only send about
// 6 to 7 items at a time, so let's stick with 6
- int MAX_ITEMS_PER_PACKET = 5;
+ int MAX_ITEMS_PER_PACKET = 6;
int totalItems = fetchItems ? items.Count : 0;
int totalFolders = fetchFolders ? folders.Count : 0;
--
cgit v1.1
From 535f4597c1de74180f59dd97c5b8888eaf12c01a Mon Sep 17 00:00:00 2001
From: Melanie
Date: Wed, 4 Nov 2009 04:36:19 +0000
Subject: Add an overload to OutPacket as per jhurliman. Switch hacky
workaround for InventoryDescendents to the proper way
---
OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 20 +++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index 09c5dfa..2da6d98 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -1306,14 +1306,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
currentPacket.ItemData[itemsSent % MAX_ITEMS_PER_PACKET] = CreateItemDataBlock(items[itemsSent++]);
else
{
- OutPacket(currentPacket, ThrottleOutPacketType.Asset);
+ OutPacket(currentPacket, ThrottleOutPacketType.Asset, false);
currentPacket = null;
}
}
if (currentPacket != null)
- OutPacket(currentPacket, ThrottleOutPacketType.Asset);
+ OutPacket(currentPacket, ThrottleOutPacketType.Asset, false);
}
private InventoryDescendentsPacket.FolderDataBlock CreateFolderDataBlock(InventoryFolderBase folder)
@@ -1415,9 +1415,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
descend.AgentData.Version = version;
descend.AgentData.Descendents = descendents;
- // Disable multiple packets
- descend.HasVariableBlocks = false;
-
if (folders > 0)
descend.FolderData = new InventoryDescendentsPacket.FolderDataBlock[folders];
else
@@ -4909,6 +4906,19 @@ namespace OpenSim.Region.ClientStack.LindenUDP
m_udpServer.SendPacket(m_udpClient, packet, throttlePacketType, true);
}
+ ///
+ /// This is the starting point for sending a simulator packet out to the client
+ ///
+ /// Packet to send
+ /// Throttling category for the packet
+ /// True to automatically split oversized
+ /// packets (the default), or false to disable splitting if the calling code
+ /// handles splitting manually
+ protected void OutPacket(Packet packet, ThrottleOutPacketType throttlePacketType, bool doAutomaticSplitting)
+ {
+ m_udpServer.SendPacket(m_udpClient, packet, throttlePacketType, doAutomaticSplitting);
+ }
+
public bool AddMoney(int debit)
{
if (m_moneyBalance + debit >= 0)
--
cgit v1.1
From 9dd5d63495cac6717057b47f3ac9ef89685281cc Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Wed, 4 Nov 2009 19:44:28 +0000
Subject: minor: remove some mono compiler warnings
---
OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs | 14 +++++++-------
OpenSim/Region/Framework/Scenes/Scene.cs | 2 +-
OpenSim/Region/Framework/Scenes/ScenePresence.cs | 10 +++++-----
3 files changed, 13 insertions(+), 13 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs b/OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs
index 244ac3b..7a66d23 100644
--- a/OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs
+++ b/OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs
@@ -77,13 +77,13 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid
#region Internal functions
- private string UserAssetURL(UUID userID)
- {
- CachedUserInfo uinfo = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(userID);
- if (uinfo != null)
- return (uinfo.UserProfile.UserAssetURI == "") ? null : uinfo.UserProfile.UserAssetURI;
- return null;
- }
+// private string UserAssetURL(UUID userID)
+// {
+// CachedUserInfo uinfo = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(userID);
+// if (uinfo != null)
+// return (uinfo.UserProfile.UserAssetURI == "") ? null : uinfo.UserProfile.UserAssetURI;
+// return null;
+// }
// private string UserInventoryURL(UUID userID)
// {
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index a6ee40a..093ca3e 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -1043,7 +1043,7 @@ namespace OpenSim.Region.Framework.Scenes
TimeSpan SinceLastFrame = DateTime.UtcNow - m_lastupdate;
physicsFPS = 0f;
- maintc = maintc = otherMS = Environment.TickCount;
+ maintc = otherMS = Environment.TickCount;
int tmpFrameMS = maintc;
// Increment the frame counter
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 6c0d9f2..124f4c0 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -76,7 +76,7 @@ namespace OpenSim.Region.Framework.Scenes
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private static readonly byte[] BAKE_INDICES = new byte[] { 8, 9, 10, 11, 19, 20 };
- private static readonly byte[] DEFAULT_TEXTURE = AvatarAppearance.GetDefaultTexture().GetBytes();
+// private static readonly byte[] DEFAULT_TEXTURE = AvatarAppearance.GetDefaultTexture().GetBytes();
private static readonly Array DIR_CONTROL_FLAGS = Enum.GetValues(typeof(Dir_ControlFlags));
private static readonly Vector3 HEAD_ADJUSTMENT = new Vector3(0f, 0f, 0.3f);
///
@@ -181,7 +181,7 @@ namespace OpenSim.Region.Framework.Scenes
private byte m_state;
//Reuse the Vector3 instead of creating a new one on the UpdateMovement method
- private Vector3 movementvector;
+// private Vector3 movementvector;
private bool m_autopilotMoving;
private Vector3 m_autoPilotTarget;
@@ -2068,7 +2068,7 @@ namespace OpenSim.Region.Framework.Scenes
if (heldDown) { move.Z -= 1; }
// Is the avatar trying to move?
- bool moving = (move != Vector3.Zero);
+// bool moving = (move != Vector3.Zero);
bool jumping = m_animTickJump != 0;
#endregion Inputs
@@ -2320,7 +2320,7 @@ namespace OpenSim.Region.Framework.Scenes
if (m_isChildAgent == false)
{
- PhysicsActor actor = m_physicsActor;
+// PhysicsActor actor = m_physicsActor;
// NOTE: Velocity is not the same as m_velocity. Velocity will attempt to
// grab the latest PhysicsActor velocity, whereas m_velocity is often
@@ -3256,7 +3256,7 @@ namespace OpenSim.Region.Framework.Scenes
Vector3 force = m_forceToApply.Value;
m_updateflag = true;
- movementvector = force;
+// movementvector = force;
Velocity = force;
m_forceToApply = null;
--
cgit v1.1
From 58be90d2b167719267fde18f2983b5a64f8b6f37 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Wed, 4 Nov 2009 22:47:40 +0000
Subject: Add some length to the backet buffer for packet sending so oversize
inventory packets don't make us barf
---
OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
index 93946ae..93c3270 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
@@ -327,7 +327,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// The vast majority of packets are less than 200 bytes, although due to asset transfers and packet splitting
// there are a decent number of packets in the 1000-1140 byte range. We allocate one of two sizes of data here
// to accomodate for both common scenarios and provide ample room for ACK appending in both
- int bufferSize = (dataLength > 180) ? LLUDPServer.MTU : 200;
+ int bufferSize = (dataLength > 180) ? LLUDPServer.MTU + 1000 : 200;
UDPPacketBuffer buffer = new UDPPacketBuffer(udpClient.RemoteEndPoint, bufferSize);
--
cgit v1.1