本文整理汇总了C#中OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString.ToString方法的具体用法?C# OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString.ToString怎么用?C# OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString.ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString
的用法示例。
在下文中一共展示了OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString.ToString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: osGetNumberOfAttachments
public LSL_List osGetNumberOfAttachments(LSL_Key avatar, LSL_List attachmentPoints)
{
CheckThreatLevel(ThreatLevel.Moderate, "osGetNumberOfAttachments");
m_host.AddScriptLPS(1);
UUID targetUUID;
ScenePresence target;
LSL_List resp = new LSL_List();
if (attachmentPoints.Length >= 1 && UUID.TryParse(avatar.ToString(), out targetUUID) && World.TryGetScenePresence(targetUUID, out target))
{
foreach (object point in attachmentPoints.Data)
{
LSL_Integer ipoint = new LSL_Integer(
(point is LSL_Integer || point is int || point is uint) ?
(int)point :
0
);
resp.Add(ipoint);
if (ipoint == 0)
{
// indicates zero attachments
resp.Add(new LSL_Integer(0));
}
else
{
// gets the number of attachments on the attachment point
resp.Add(new LSL_Integer(target.GetAttachments((uint)ipoint).Count));
}
}
}
return resp;
}
示例2: osMessageAttachments
public void osMessageAttachments(LSL_Key avatar, string message, LSL_List attachmentPoints, int options)
{
CheckThreatLevel(ThreatLevel.Moderate, "osMessageAttachments");
m_host.AddScriptLPS(1);
UUID targetUUID;
if(!UUID.TryParse(avatar.ToString(), out targetUUID))
return;
if(targetUUID == UUID.Zero)
return;
ScenePresence target;
if(!World.TryGetScenePresence(targetUUID, out target))
return;
if(target.IsDeleted || target.IsInTransit)
return;
List<int> aps = new List<int>();
if(attachmentPoints.Length != 0)
{
foreach (object point in attachmentPoints.Data)
{
int ipoint;
if (int.TryParse(point.ToString(), out ipoint))
{
aps.Add(ipoint);
}
}
// parsing failed
if(aps.Count != attachmentPoints.Length)
return;
}
List<SceneObjectGroup> attachments = new List<SceneObjectGroup>();
bool msgAll;
bool invertPoints = (options & ScriptBaseClass.OS_ATTACH_MSG_INVERT_POINTS) != 0;
if(aps.Count == 0)
{
if(!invertPoints)
return;
msgAll = true;
invertPoints = false;
}
else
msgAll = aps.Contains(ScriptBaseClass.OS_ATTACH_MSG_ALL);
if (msgAll && invertPoints)
return;
if (msgAll || invertPoints)
{
attachments = target.GetAttachments();
}
else
{
foreach (int point in aps)
{
if (point > 0)
{
attachments.AddRange(target.GetAttachments((uint)point));
}
}
}
// if we have no attachments at this point, exit now
if (attachments.Count == 0)
{
return;
}
bool optionObjCreator = (options &
ScriptBaseClass.OS_ATTACH_MSG_OBJECT_CREATOR) != 0;
bool optionScriptCreator = (options &
ScriptBaseClass.OS_ATTACH_MSG_SCRIPT_CREATOR) != 0;
UUID hostCreatorID = m_host.CreatorID;
UUID itemCreatorID = m_item.CreatorID;
foreach (SceneObjectGroup sog in attachments)
{
if(sog.IsDeleted || sog.inTransit)
continue;
if (invertPoints && aps.Contains((int)sog.AttachmentPoint))
continue;
UUID CreatorID = sog.RootPart.CreatorID;
if (optionObjCreator && CreatorID != hostCreatorID)
continue;
if (optionScriptCreator && CreatorID != itemCreatorID)
continue;
SceneObjectPart[] parts = sog.Parts;
foreach(SceneObjectPart p in parts)
MessageObject(p.UUID, message);
//.........这里部分代码省略.........
示例3: osMessageAttachments
public void osMessageAttachments(LSL_Key avatar, string message, LSL_List attachmentPoints, int options)
{
CheckThreatLevel(ThreatLevel.Moderate, "osMessageAttachments");
m_host.AddScriptLPS(1);
UUID targetUUID;
ScenePresence target;
if (attachmentPoints.Length >= 1 && UUID.TryParse(avatar.ToString(), out targetUUID) && World.TryGetScenePresence(targetUUID, out target))
{
List<int> aps = new List<int>();
foreach (object point in attachmentPoints.Data)
{
int ipoint;
if (int.TryParse(point.ToString(), out ipoint))
{
aps.Add(ipoint);
}
}
List<SceneObjectGroup> attachments = new List<SceneObjectGroup>();
bool msgAll = aps.Contains(ScriptBaseClass.OS_ATTACH_MSG_ALL);
bool invertPoints = (options & ScriptBaseClass.OS_ATTACH_MSG_INVERT_POINTS) != 0;
if (msgAll && invertPoints)
{
return;
}
else if (msgAll || invertPoints)
{
attachments = target.GetAttachments();
}
else
{
foreach (int point in aps)
{
if (point > 0)
{
attachments.AddRange(target.GetAttachments((uint)point));
}
}
}
// if we have no attachments at this point, exit now
if (attachments.Count == 0)
{
return;
}
List<SceneObjectGroup> ignoreThese = new List<SceneObjectGroup>();
if (invertPoints)
{
foreach (SceneObjectGroup attachment in attachments)
{
if (aps.Contains((int)attachment.AttachmentPoint))
{
ignoreThese.Add(attachment);
}
}
}
foreach (SceneObjectGroup attachment in ignoreThese)
{
attachments.Remove(attachment);
}
ignoreThese.Clear();
// if inverting removed all attachments to check, exit now
if (attachments.Count < 1)
{
return;
}
if ((options & ScriptBaseClass.OS_ATTACH_MSG_OBJECT_CREATOR) != 0)
{
foreach (SceneObjectGroup attachment in attachments)
{
if (attachment.RootPart.CreatorID != m_host.CreatorID)
{
ignoreThese.Add(attachment);
}
}
foreach (SceneObjectGroup attachment in ignoreThese)
{
attachments.Remove(attachment);
}
ignoreThese.Clear();
// if filtering by same object creator removed all
// attachments to check, exit now
if (attachments.Count == 0)
{
return;
}
}
if ((options & ScriptBaseClass.OS_ATTACH_MSG_SCRIPT_CREATOR) != 0)
//.........这里部分代码省略.........