本文整理汇总了C#中LSL_Types.GetLSLStringItem方法的典型用法代码示例。如果您正苦于以下问题:C# LSL_Types.GetLSLStringItem方法的具体用法?C# LSL_Types.GetLSLStringItem怎么用?C# LSL_Types.GetLSLStringItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LSL_Types
的用法示例。
在下文中一共展示了LSL_Types.GetLSLStringItem方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: osMakeNotecard
// This needs ThreatLevel high. It is an excellent griefer tool,
// In a loop, it can cause asset bloat and DOS levels of asset
// writes.
//
public void osMakeNotecard(string notecardName, LSL_Types.list contents)
{
if(!ScriptProtection.CheckThreatLevel(ThreatLevel.High, "osMakeNotecard", m_host, "OSSL", m_itemID)) return;
// Create new asset
AssetBase asset = new AssetBase(UUID.Random(), notecardName, AssetType.Notecard, m_host.OwnerID);
asset.Description = "Script Generated Notecard";
string notecardData = String.Empty;
for (int i = 0; i < contents.Length; i++)
{
notecardData += contents.GetLSLStringItem(i) + "\n";
}
int textLength = notecardData.Length;
notecardData = "Linden text version 2\n{\nLLEmbeddedItems version 1\n{\ncount 0\n}\nText length "
+ textLength.ToString() + "\n" + notecardData + "}\n";
asset.Data = Util.UTF8.GetBytes(notecardData);
asset.FillHash();
asset.ID = World.AssetService.Store(asset);
// Create Task Entry
TaskInventoryItem taskItem = new TaskInventoryItem();
taskItem.ResetIDs(m_host.UUID);
taskItem.ParentID = m_host.UUID;
taskItem.CreationDate = (uint)Util.UnixTimeSinceEpoch();
taskItem.Name = asset.Name;
taskItem.Description = asset.Description;
taskItem.Type = (int)AssetType.Notecard;
taskItem.InvType = (int)InventoryType.Notecard;
taskItem.OwnerID = m_host.OwnerID;
taskItem.CreatorID = m_host.OwnerID;
taskItem.BasePermissions = (uint)PermissionMask.All;
taskItem.CurrentPermissions = (uint)PermissionMask.All;
taskItem.EveryonePermissions = 0;
taskItem.NextPermissions = (uint)PermissionMask.All;
taskItem.GroupID = m_host.GroupID;
taskItem.GroupPermissions = 0;
taskItem.Flags = 0;
taskItem.SalePrice = 0;
taskItem.SaleType = 0;
taskItem.PermsGranter = UUID.Zero;
taskItem.PermsMask = 0;
taskItem.AssetID = asset.ID;
m_host.Inventory.AddInventoryItem(taskItem, false);
}
示例2: osMakeNotecard
/// <summary>
/// Write a notecard directly to the prim's inventory.
/// </summary>
/// <remarks>
/// This needs ThreatLevel high. It is an excellent griefer tool,
/// In a loop, it can cause asset bloat and DOS levels of asset
/// writes.
/// </remarks>
/// <param name="notecardName">The name of the notecard to write.</param>
/// <param name="contents">The contents of the notecard.</param>
public void osMakeNotecard(string notecardName, LSL_Types.list contents)
{
m_host.AddScriptLPS(1);
StringBuilder notecardData = new StringBuilder();
for (int i = 0; i < contents.Length; i++)
notecardData.Append((string)(contents.GetLSLStringItem(i) + "\n"));
SaveNotecard(notecardName, "Script generated notecard", notecardData.ToString(), false);
}