mirror of
https://github.com/opensim/opensim.git
synced 2026-08-12 20:55:43 +08:00
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:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user