preliminary support for editing notecards and scripts.

Although there seems to sometimes be a problem of when you login again, old notecards and scripts will have their permissions messed up and you won't be able to even view their text. This seems to be related to the client's cache, and if you clear your client's cache, on the next login they should be fine again. [I have a couple of ideas about what might be causing this so hopefully will have it fixed soon.]
This commit is contained in:
MW
2007-08-14 19:19:09 +00:00
parent 16defc30eb
commit a979808493
7 changed files with 164 additions and 22 deletions

View File

@@ -732,15 +732,6 @@ namespace OpenSim.Region.Environment.Scenes
}
}
/// <summary>
/// Sends prims to a client
/// </summary>
/// <param name="RemoteClient">Client to send to</param>
public void GetInitialPrims(IClientAPI RemoteClient)
{
}
public void ProcessObjectGrab(uint localID, LLVector3 offsetPos, IClientAPI remoteClient)
{
this.EventManager.TriggerObjectGrab(localID, offsetPos, remoteClient);

View File

@@ -827,6 +827,7 @@ namespace OpenSim.Region.Environment.Scenes
agent.CapsPath, agent.AgentID);
cap.RegisterHandlers();
cap.AddNewInventoryItem = this.AddInventoryItem;
cap.ItemUpdatedCall = this.UpdateInventoryItemAsset;
if (capsHandlers.ContainsKey(agent.AgentID))
{
MainLog.Instance.Warn("client", "Adding duplicate CAPS entry for user " +
@@ -1023,7 +1024,7 @@ namespace OpenSim.Region.Environment.Scenes
{
ScriptEngines.Add(ScriptEngine);
ScriptEngine.InitializeEngine(this, m_logger);
ScriptEngine.InitializeEngine(this, m_logger);
}
#endregion
@@ -1046,7 +1047,7 @@ namespace OpenSim.Region.Environment.Scenes
public void AddInventoryItem(LLUUID userID, InventoryItemBase item)
{
if(this.Avatars.ContainsKey(userID))
if (this.Avatars.ContainsKey(userID))
{
this.AddInventoryItem(this.Avatars[userID].ControllingClient, item);
}
@@ -1062,5 +1063,45 @@ namespace OpenSim.Region.Environment.Scenes
}
}
public LLUUID UpdateInventoryItemAsset(LLUUID userID, LLUUID itemID, byte[] data)
{
if (this.Avatars.ContainsKey(userID))
{
return this.UpdateInventoryItemAsset(this.Avatars[userID].ControllingClient, itemID, data);
}
return LLUUID.Zero;
}
public LLUUID UpdateInventoryItemAsset(IClientAPI remoteClient, LLUUID itemID, byte[] data)
{
CachedUserInfo userInfo = commsManager.UserProfiles.GetUserDetails(remoteClient.AgentId);
if (userInfo != null)
{
if (userInfo.RootFolder != null)
{
InventoryItemBase item = userInfo.RootFolder.HasItem(itemID);
if (item != null)
{
AssetBase asset;
asset = new AssetBase();
asset.FullID = LLUUID.Random();
asset.Type = (sbyte)item.assetType;
asset.InvType = (sbyte)item.invType;
asset.Name = item.inventoryName;
asset.Data = data;
this.assetCache.AddAsset(asset);
item.assetID = asset.FullID;
userInfo.updateItem(remoteClient.AgentId, item);
remoteClient.SendInventoryItemUpdate(item);
return (asset.FullID);
}
}
}
return LLUUID.Zero;
}
}
}