本文整理汇总了C#中IClientAPI.SendInventoryItemDetails方法的典型用法代码示例。如果您正苦于以下问题:C# IClientAPI.SendInventoryItemDetails方法的具体用法?C# IClientAPI.SendInventoryItemDetails怎么用?C# IClientAPI.SendInventoryItemDetails使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IClientAPI
的用法示例。
在下文中一共展示了IClientAPI.SendInventoryItemDetails方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ChangeInventoryItemFlags
/// <summary>
/// Change an inventory items flags
/// </summary>
/// <param name="remoteClient"></param>
/// <param name="itemID"></param>
/// <param name="Flags"></param>
protected void ChangeInventoryItemFlags(IClientAPI remoteClient, UUID itemID, uint Flags)
{
InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId);
item = m_scene.InventoryService.GetItem(item);
if (item != null)
{
item.Flags = Flags;
m_scene.InventoryService.UpdateItem(item);
remoteClient.SendInventoryItemDetails(item.Owner, item);
}
else
{
MainConsole.Instance.Error(
"[AGENTINVENTORY]: Item ID " + itemID + " not found for an inventory item update.");
}
}
示例2: HandleFetchInventory
/// <summary>
/// Handle a fetch inventory request from the client
/// </summary>
/// <param name="remoteClient"></param>
/// <param name="itemID"></param>
/// <param name="ownerID"></param>
protected void HandleFetchInventory(IClientAPI remoteClient, UUID itemID, UUID ownerID)
{
//MainConsole.Instance.Warn("[Scene.PacketHandler]: Depriated UDP Inventory request!");
InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId);
item = m_scene.InventoryService.GetItem(item);
if (item != null)
{
remoteClient.SendInventoryItemDetails(ownerID, item);
}
// else shouldn't we send an alert message?
}
示例3: HandleFetchInventory
/// <summary>
/// Handle a fetch inventory request from the client
/// </summary>
/// <param name="remoteClient"></param>
/// <param name="itemID"></param>
/// <param name="ownerID"></param>
public void HandleFetchInventory(IClientAPI remoteClient, UUID itemID, UUID ownerID)
{
if (ownerID == CommsManager.UserProfileCacheService.LibraryRoot.Owner)
{
//m_log.Debug("request info for library item");
return;
}
InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId);
item = InventoryService.GetItem(item);
if (item != null)
{
remoteClient.SendInventoryItemDetails(ownerID, item);
}
// else shouldn't we send an alert message?
}
示例4: UpdateInventoryItemAsset
/// <summary>
/// Update an item which is either already in the client's inventory or is within
/// a transaction
/// </summary>
/// <param name="remoteClient"></param>
/// <param name="transactionID">The transaction ID. If this is UUID.Zero we will
/// assume that we are not in a transaction</param>
/// <param name="itemID">The ID of the updated item</param>
/// <param name="name">The name of the updated item</param>
/// <param name="description">The description of the updated item</param>
/// <param name="nextOwnerMask">The permissions of the updated item</param>
/* public void UpdateInventoryItemAsset(IClientAPI remoteClient, UUID transactionID,
UUID itemID, string name, string description,
uint nextOwnerMask)*/
public void UpdateInventoryItemAsset(IClientAPI remoteClient, UUID transactionID,
UUID itemID, InventoryItemBase itemUpd)
{
CachedUserInfo userInfo = CommsManager.UserService.GetUserDetails(remoteClient.AgentId);
if (userInfo == null)
{
m_log.Error("[AGENT INVENTORY]: Agent ID " + remoteClient.AgentId + " inventory not found for item update.");
return;
}
InventoryItemBase item = userInfo.FindItem(itemID);
if (item == null)
{
m_log.Error("[AGENTINVENTORY]: Item ID " + itemID + " not found for an inventory item update.");
return;
}
//make sure we actually OWN the item
if (item.Owner != remoteClient.AgentId)
{
m_log.ErrorFormat("[AGENT INVENTORY]: User {0} does not own item {1}, not updating",
remoteClient.AgentId, itemID);
remoteClient.SendInventoryItemDetails(item.Owner, item);
return;
}
// Update the item with the changes passed to us from the viewer
item.Name = itemUpd.Name;
item.Description = itemUpd.Description;
// Limit perms updates to base permissions (0 means no change?)
if (itemUpd.EveryOnePermissions == 0)
itemUpd.EveryOnePermissions = item.EveryOnePermissions;
else
itemUpd.EveryOnePermissions &= item.BasePermissions;
if (itemUpd.GroupPermissions == 0)
itemUpd.GroupPermissions &= item.GroupPermissions;
else
itemUpd.GroupPermissions &= item.BasePermissions;
if (itemUpd.NextPermissions == 0)
itemUpd.NextPermissions &= item.NextPermissions;
else
itemUpd.NextPermissions &= item.BasePermissions;
// Check for permissions changes
if (ChangingInventoryItemPerms(item, itemUpd))
{
if (InventoryItemIsAttached(remoteClient, itemID))
{
remoteClient.SendAlertMessage("To change an attachment's permissions, you must first drop it or detach it.");
remoteClient.SendInventoryItemDetails(item.Owner, item);
return;
}
if (!MatchInventoryRootPartStoredOwner(item, 0, item.Owner))
{
// This item has been recently transferred between users, and not rezzed.
// We cannot allow permissions changes in this state. Rezzing it fixes it.
// See http://inworldz.com/mantis/view.php?id=1664
remoteClient.SendAlertMessage("You cannot change the Next Owner permissions on this item until it has been rezzed in-world by you at least once.");
InformClientOfInvChange(remoteClient, item);
return;
}
// Perform the actual permissions update now.
item.EveryOnePermissions = itemUpd.EveryOnePermissions;
item.GroupPermissions = itemUpd.GroupPermissions;
item.NextPermissions = itemUpd.NextPermissions;
if (item.InvType == (int)InventoryType.Object)
{
item.CurrentPermissions |= ScenePermBits.SLAM; // Slam!
item.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm; // Tell the viewer we are going to slam this
}
}
item.GroupID = itemUpd.GroupID;
item.GroupOwned = itemUpd.GroupOwned;
item.CreationDate = itemUpd.CreationDate;
// The client sends zero if its newly created?
if (itemUpd.CreationDate == 0)
item.CreationDate = Util.UnixTimeSinceEpoch();
else
item.CreationDate = itemUpd.CreationDate;
// TODO: Check if folder changed and move item
//item.NextPermissions = itemUpd.Folder;
item.InvType = itemUpd.InvType;
//.........这里部分代码省略.........
示例5: HandleFetchInventory
/// <summary>
/// Handle a fetch inventory request from the client
/// </summary>
/// <param name="remoteClient"></param>
/// <param name="itemID"></param>
/// <param name="ownerID"></param>
public void HandleFetchInventory(IClientAPI remoteClient, UUID itemID, UUID ownerID)
{
if (ownerID == CommsManager.LibraryRoot.Owner)
{
//m_log.Debug("request info for library item");
return;
}
CachedUserInfo userProfile = CommsManager.UserService.GetUserDetails(remoteClient.AgentId);
if (null == userProfile)
{
m_log.ErrorFormat(
"[AGENT INVENTORY]: Could not find user profile for {0} {1}",
remoteClient.Name, remoteClient.AgentId);
return;
}
InventoryItemBase item = userProfile.FindItem(itemID);
if (item != null)
{
remoteClient.SendInventoryItemDetails(ownerID, item);
}
}