change CopyInventoryFromNotecard to simpleh..
parent
b069b668e4
commit
d42c7e5e32
|
@ -252,11 +252,6 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
//m_capsHandlers["MapLayer"] =
|
|
||||||
// new LLSDStreamhandler<OSDMapRequest, OSDMapLayerResponse>("POST",
|
|
||||||
// GetNewCapPath(),
|
|
||||||
// GetMapLayer);
|
|
||||||
|
|
||||||
m_HostCapsObj.RegisterSimpleHandler("GetObjectPhysicsData",
|
m_HostCapsObj.RegisterSimpleHandler("GetObjectPhysicsData",
|
||||||
new SimpleOSDMapHandler("POST", GetNewCapPath(), GetObjectPhysicsData));
|
new SimpleOSDMapHandler("POST", GetNewCapPath(), GetObjectPhysicsData));
|
||||||
|
|
||||||
|
@ -266,8 +261,6 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||||
m_HostCapsObj.RegisterSimpleHandler("ResourceCostSelected",
|
m_HostCapsObj.RegisterSimpleHandler("ResourceCostSelected",
|
||||||
new SimpleOSDMapHandler("POST", GetNewCapPath(), ResourceCostSelected));
|
new SimpleOSDMapHandler("POST", GetNewCapPath(), ResourceCostSelected));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(m_AllowCapHomeLocation)
|
if(m_AllowCapHomeLocation)
|
||||||
{
|
{
|
||||||
m_HostCapsObj.RegisterSimpleHandler("HomeLocation",
|
m_HostCapsObj.RegisterSimpleHandler("HomeLocation",
|
||||||
|
@ -280,12 +273,6 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||||
new SimpleStreamHandler(GetNewCapPath(), GroupMemberData));
|
new SimpleStreamHandler(GetNewCapPath(), GroupMemberData));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// IRequestHandler animSetRequestHandler
|
|
||||||
// = new RestStreamHandler(
|
|
||||||
// "POST", capsBase + m_animSetTaskUpdatePath, AnimSetTaskInventory, "UpdateScript", null);
|
|
||||||
|
|
||||||
// m_HostCapsObj.RegisterHandler("UpdateAnimSetTaskInventory", animSetRequestHandler);
|
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
@ -311,6 +298,7 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||||
|
|
||||||
oreq = new SimpleOSDMapHandler("POST", GetNewCapPath(), UpdateAnimSetItemAsset);
|
oreq = new SimpleOSDMapHandler("POST", GetNewCapPath(), UpdateAnimSetItemAsset);
|
||||||
m_HostCapsObj.RegisterSimpleHandler("UpdateAnimSetAgentInventory", oreq, true);
|
m_HostCapsObj.RegisterSimpleHandler("UpdateAnimSetAgentInventory", oreq, true);
|
||||||
|
//m_HostCapsObj.RegisterSimpleHandler("UpdateAnimSetTaskInventory", oreq, false);
|
||||||
|
|
||||||
oreq = new SimpleOSDMapHandler("POST", GetNewCapPath(), UpdateScriptItemAsset);
|
oreq = new SimpleOSDMapHandler("POST", GetNewCapPath(), UpdateScriptItemAsset);
|
||||||
m_HostCapsObj.RegisterSimpleHandler("UpdateScriptAgent", oreq, true);
|
m_HostCapsObj.RegisterSimpleHandler("UpdateScriptAgent", oreq, true);
|
||||||
|
@ -335,9 +323,8 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||||
m_HostCapsObj.RegisterSimpleHandler("UpdateAgentInformation",
|
m_HostCapsObj.RegisterSimpleHandler("UpdateAgentInformation",
|
||||||
new SimpleStreamHandler(GetNewCapPath(), UpdateAgentInformation));
|
new SimpleStreamHandler(GetNewCapPath(), UpdateAgentInformation));
|
||||||
|
|
||||||
IRequestHandler CopyInventoryFromNotecardHandler = new RestStreamHandler(
|
m_HostCapsObj.RegisterSimpleHandler("CopyInventoryFromNotecard",
|
||||||
"POST", GetNewCapPath(), CopyInventoryFromNotecard, "CopyInventoryFromNotecard", null);
|
new SimpleOSDMapHandler("POST", GetNewCapPath(), CopyInventoryFromNotecard));
|
||||||
m_HostCapsObj.RegisterHandler("CopyInventoryFromNotecard", CopyInventoryFromNotecardHandler);
|
|
||||||
|
|
||||||
m_HostCapsObj.RegisterSimpleHandler("CreateInventoryCategory",
|
m_HostCapsObj.RegisterSimpleHandler("CreateInventoryCategory",
|
||||||
new SimpleStreamHandler(GetNewCapPath(), CreateInventoryCategory));
|
new SimpleStreamHandler(GetNewCapPath(), CreateInventoryCategory));
|
||||||
|
@ -1277,14 +1264,6 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||||
httpResponse.StatusCode = (int)HttpStatusCode.BadRequest;
|
httpResponse.StatusCode = (int)HttpStatusCode.BadRequest;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private string CopyInventoryFromNotecardError(IOSHttpResponse response)
|
|
||||||
{
|
|
||||||
response.StatusCode = (int)HttpStatusCode.NotFound;
|
|
||||||
response.StatusDescription = "";
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Called by the CopyInventoryFromNotecard caps handler.
|
/// Called by the CopyInventoryFromNotecard caps handler.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -1292,15 +1271,15 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||||
/// <param name="path"></param>
|
/// <param name="path"></param>
|
||||||
/// <param name="param"></param>
|
/// <param name="param"></param>
|
||||||
|
|
||||||
public string CopyInventoryFromNotecard(string request, string path, string param,
|
public void CopyInventoryFromNotecard(IOSHttpRequest httpRequest, IOSHttpResponse httpResponse, OSDMap content)
|
||||||
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
|
||||||
{
|
{
|
||||||
InventoryItemBase copyItem = null;
|
InventoryItemBase copyItem = null;
|
||||||
IClientAPI client = null;
|
IClientAPI client = null;
|
||||||
|
|
||||||
|
httpResponse.StatusCode = (int)HttpStatusCode.OK;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
OSDMap content = (OSDMap)OSDParser.DeserializeLLSDXml(request);
|
|
||||||
UUID objectID = content["object-id"].AsUUID();
|
UUID objectID = content["object-id"].AsUUID();
|
||||||
UUID notecardID = content["notecard-id"].AsUUID();
|
UUID notecardID = content["notecard-id"].AsUUID();
|
||||||
UUID folderID = content["folder-id"].AsUUID();
|
UUID folderID = content["folder-id"].AsUUID();
|
||||||
|
@ -1317,14 +1296,15 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||||
{
|
{
|
||||||
SceneObjectPart part = m_Scene.GetSceneObjectPart(objectID);
|
SceneObjectPart part = m_Scene.GetSceneObjectPart(objectID);
|
||||||
if(part == null)
|
if(part == null)
|
||||||
throw new Exception("find object with notecard item" + notecardID.ToString());
|
throw new Exception("failed to find object with notecard item" + notecardID.ToString());
|
||||||
|
|
||||||
if (!m_Scene.Permissions.CanCopyObjectInventory(notecardID, objectID, agentID))
|
|
||||||
return CopyInventoryFromNotecardError(httpResponse);
|
|
||||||
|
|
||||||
TaskInventoryItem taskItem = part.Inventory.GetInventoryItem(notecardID);
|
TaskInventoryItem taskItem = part.Inventory.GetInventoryItem(notecardID);
|
||||||
if(taskItem == null || taskItem.AssetID == UUID.Zero)
|
if (taskItem == null || taskItem.AssetID == UUID.Zero)
|
||||||
throw new Exception("Failed to find notecard item" + notecardID.ToString());
|
throw new Exception("Failed to find notecard item" + notecardID.ToString());
|
||||||
|
|
||||||
|
if (!m_Scene.Permissions.CanCopyObjectInventory(notecardID, objectID, agentID))
|
||||||
|
throw new Exception("No permission to copy notecard from object");
|
||||||
|
|
||||||
noteAssetID = taskItem.AssetID;
|
noteAssetID = taskItem.AssetID;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1341,7 +1321,7 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||||
m_log.InfoFormat("[CAPS]: CopyInventoryFromNotecard, ItemID:{0}, FolderID:{1}", copyItem.ID, copyItem.Folder);
|
m_log.InfoFormat("[CAPS]: CopyInventoryFromNotecard, ItemID:{0}, FolderID:{1}", copyItem.ID, copyItem.Folder);
|
||||||
if (client != null)
|
if (client != null)
|
||||||
client.SendBulkUpdateInventory(copyItem);
|
client.SendBulkUpdateInventory(copyItem);
|
||||||
return "";
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (notecardID != UUID.Zero)
|
if (notecardID != UUID.Zero)
|
||||||
|
@ -1455,7 +1435,7 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||||
m_log.InfoFormat("[CAPS]: CopyInventoryFromNotecard, ItemID:{0} FolderID:{1}", item.ID, item.Folder);
|
m_log.InfoFormat("[CAPS]: CopyInventoryFromNotecard, ItemID:{0} FolderID:{1}", item.ID, item.Folder);
|
||||||
if (client != null)
|
if (client != null)
|
||||||
client.SendBulkUpdateInventory(item);
|
client.SendBulkUpdateInventory(item);
|
||||||
return "";
|
return;
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
@ -1467,10 +1447,8 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||||
{
|
{
|
||||||
if (client != null)
|
if (client != null)
|
||||||
client.SendAlertMessage("Failed to retrieve item");
|
client.SendAlertMessage("Failed to retrieve item");
|
||||||
return CopyInventoryFromNotecardError(httpResponse);
|
httpResponse.StatusCode = (int)HttpStatusCode.BadRequest;
|
||||||
}
|
}
|
||||||
|
|
||||||
return "";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void GetObjectPhysicsData(IOSHttpRequest httpRequest, IOSHttpResponse httpResponse, OSDMap req)
|
public void GetObjectPhysicsData(IOSHttpRequest httpRequest, IOSHttpResponse httpResponse, OSDMap req)
|
||||||
|
|
Loading…
Reference in New Issue