Prim inventory script saving phase 1. Create necessary CAPS structures for correctly accepting prim inventory script updates.

No user functionality yet.
Refactoring to follow.
This commit is contained in:
Justin Clarke Casey
2007-12-24 22:35:01 +00:00
parent fa2495ae6b
commit 280a5cba8b
7 changed files with 343 additions and 11 deletions

View File

@@ -74,6 +74,13 @@ namespace OpenSim.Region.Environment.Scenes
return LLUUID.Zero;
}
/// <summary>
/// Capability originating call to update the asset of an item in an agent's inventory
/// </summary>
/// <param name="remoteClient"></param>
/// <param name="itemID"></param>
/// <param name="data"></param>
/// <returns></returns>
public LLUUID CapsUpdateInventoryItemAsset(IClientAPI remoteClient, LLUUID itemID, byte[] data)
{
CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId);
@@ -106,6 +113,39 @@ namespace OpenSim.Region.Environment.Scenes
}
return LLUUID.Zero;
}
/// <summary>
/// Capability originating call to update the asset of a script in a prim's (task's) inventory
/// </summary>
/// <param name="remoteClient"></param>
/// <param name="itemID"></param>
/// <param name="primID">The prim which contains the item to update</param>
/// <param name="isScriptRunning">Indicates whether the script to update is currently running</param>
/// <param name="data"></param>
/// <returns>Asset LLUID created</returns>
public LLUUID CapsUpdateTaskInventoryScriptAsset(LLUUID avatarID, LLUUID itemID,
LLUUID primID, bool isScriptRunning, byte[] data)
{
// TODO Not currently doing anything with the isScriptRunning bool
MainLog.Instance.Verbose(
"PRIMINVENTORY",
"Prim inventory script save functionality not yet implemented."
+ " remoteClient: {0}, itemID: {1}, primID: {2}, isScriptRunning: {3}",
avatarID, itemID, primID, isScriptRunning);
// TODO
// Retrieve client LLUID
// Retrieve sog containing primID
// Retrieve item
// Create new asset and add to cache
// Update item with new asset
// Trigger SOG update (see RezScript)
// Trigger rerunning of script (use TriggerRezScript event, see RezScript)
// return new asset id
return null;
}
/// <summary>
/// Update an item which is either already in the client's inventory or is within
@@ -470,7 +510,6 @@ namespace OpenSim.Region.Environment.Scenes
if (rezAsset != null)
{
string script = Util.FieldToString(rezAsset.Data);
//Console.WriteLine("rez script "+script);
EventManager.TriggerRezScript(localID, copyID, script);
rezzed = true;
}

View File

@@ -1350,10 +1350,13 @@ namespace OpenSim.Region.Environment.Scenes
agent.CapsPath, agent.AgentID, m_dumpAssetsToFile);
Util.SetCapsURL(agent.AgentID, "http://" + m_regInfo.ExternalHostName + ":" + httpListener.Port.ToString() +
"/CAPS/" + agent.CapsPath + "0000/");
"/CAPS/" + agent.CapsPath + "0000/");
cap.RegisterHandlers();
cap.AddNewInventoryItem = AddInventoryItem;
cap.ItemUpdatedCall = CapsUpdateInventoryItemAsset;
cap.TaskScriptUpdatedCall = CapsUpdateTaskInventoryScriptAsset;
if (m_capsHandlers.ContainsKey(agent.AgentID))
{
//MainLog.Instance.Warn("client", "Adding duplicate CAPS entry for user " +