mirror of
https://github.com/opensim/opensim.git
synced 2026-08-08 18:25:33 +08:00
Make copying of scripts into prim inventories more reliable on the first attempt when the asset server is lagging by formalising the de facto polling.
This may not be the best solution in the long run, but should improve things for now. This may also improve reliability when updating inventory item metadata (e.g. renaming an item) and in retrieving textures for the main map view.
This commit is contained in:
@@ -429,16 +429,15 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
//group.AddInventoryItem(rmoteClient, primLocalID, null);
|
||||
MainLog.Instance.Verbose(
|
||||
"PRIMINVENTORY",
|
||||
"UpdateTaskInventory called with item {0}, folder {1}, primLocalID {2}",
|
||||
itemID, folderID, primLocalID);
|
||||
"UpdateTaskInventory called with script {0}, folder {1}, primLocalID {2}, user {3}",
|
||||
itemID, folderID, primLocalID, remoteClient.Name);
|
||||
}
|
||||
else
|
||||
{
|
||||
MainLog.Instance.Warn(
|
||||
"PRIMINVENTORY",
|
||||
"Update with item {0} requested of prim {1} but this prim does not exist",
|
||||
itemID,
|
||||
primLocalID);
|
||||
"Update with script {0} requested of prim {1} for {2} but this prim does not exist",
|
||||
itemID, primLocalID, remoteClient.Name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -465,14 +464,9 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
{
|
||||
isTexture = true;
|
||||
}
|
||||
|
||||
AssetBase rezAsset = AssetCache.GetAsset(item.assetID, isTexture);
|
||||
|
||||
if (rezAsset == null)
|
||||
{
|
||||
// lets try once more in case the asset cache is being slow getting the asset from server
|
||||
rezAsset = AssetCache.GetAsset(item.assetID, isTexture);
|
||||
}
|
||||
|
||||
if (rezAsset != null)
|
||||
{
|
||||
string script = Util.FieldToString(rezAsset.Data);
|
||||
@@ -489,32 +483,35 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
// TODO: do we care about the value of this bool?
|
||||
group.AddInventoryItem(remoteClient, localID, item, copyID);
|
||||
group.GetProperites(remoteClient);
|
||||
|
||||
MainLog.Instance.Verbose(
|
||||
"PRIMINVENTORY",
|
||||
"Rezzed script {0} (asset {1}) into prim {2} for user {3}",
|
||||
item.inventoryName, rezAsset.FullID, localID, remoteClient.Name);
|
||||
}
|
||||
else
|
||||
{
|
||||
MainLog.Instance.Warn(
|
||||
"PRIMINVENTORY",
|
||||
"Could not rez item {0} into prim {1}"
|
||||
"Could not rez script {0} into prim {1} for user {2}"
|
||||
+ " because the prim could not be found in the region!",
|
||||
item.inventoryName,
|
||||
localID);
|
||||
item.inventoryName, localID, remoteClient.Name);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MainLog.Instance.Warn(
|
||||
"PRIMINVENTORY",
|
||||
"Could not rez item {0} into prim {1}"
|
||||
+ " because the item asset {2} could not be found!",
|
||||
item.inventoryName,
|
||||
localID,
|
||||
item.assetID);
|
||||
"Could not rez script {0} into prim {1} for user {2}"
|
||||
+ " because the item asset {3} could not be found!",
|
||||
item.inventoryName, localID, item.assetID, remoteClient.Name);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MainLog.Instance.Warn(
|
||||
"PRIMINVENTORY", "Could not find script inventory item {0} to rez!", itemID);
|
||||
"PRIMINVENTORY", "Could not find script inventory item {0} to rez for {1}!",
|
||||
itemID, remoteClient.Name);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -625,12 +622,6 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
{
|
||||
AssetBase rezAsset = AssetCache.GetAsset(item.assetID, false);
|
||||
|
||||
if (rezAsset == null)
|
||||
{
|
||||
// lets try once more in case the asset cache is being slow getting the asset from server
|
||||
rezAsset = AssetCache.GetAsset(item.assetID, false);
|
||||
}
|
||||
|
||||
if (rezAsset != null)
|
||||
{
|
||||
AddRezObject(Util.FieldToString(rezAsset.Data), pos);
|
||||
|
||||
Reference in New Issue
Block a user