本文整理汇总了C#中Universe.ScriptEngine.VirtualScript.LSL_Types.list.GetLSLStringItem方法的典型用法代码示例。如果您正苦于以下问题:C# Universe.ScriptEngine.VirtualScript.LSL_Types.list.GetLSLStringItem方法的具体用法?C# Universe.ScriptEngine.VirtualScript.LSL_Types.list.GetLSLStringItem怎么用?C# Universe.ScriptEngine.VirtualScript.LSL_Types.list.GetLSLStringItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Universe.ScriptEngine.VirtualScript.LSL_Types.list
的用法示例。
在下文中一共展示了Universe.ScriptEngine.VirtualScript.LSL_Types.list.GetLSLStringItem方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: osDrawPolygon
public string osDrawPolygon(string drawList, LSL_List x, LSL_List y)
{
if (!ScriptProtection.CheckThreatLevel(ThreatLevel.None, "osDrawFilledPolygon", m_host, "OSSL", m_itemID))
return "";
if (x.Length != y.Length || x.Length < 3)
{
return new LSL_String("");
}
drawList += "Polygon " + x.GetLSLStringItem(0) + "," + y.GetLSLStringItem(0);
for (int i = 1; i < x.Length; i++)
{
drawList += "," + x.GetLSLStringItem(i) + "," + y.GetLSLStringItem(i);
}
drawList += "; ";
return new LSL_String(drawList);
}
示例2: osSetParcelDetails
public void osSetParcelDetails(LSL_Vector pos, LSL_List rules)
{
if (!ScriptProtection.CheckThreatLevel(ThreatLevel.High, "osSetParcelDetails", m_host, "OSSL", m_itemID))
return;
// Get a reference to the land data and make sure the owner of the script
// can modify it
IParcelManagementModule parcelManagement = World.RequestModuleInterface<IParcelManagementModule>();
if (parcelManagement != null)
{
ILandObject startLandObject = parcelManagement.GetLandObject((int) pos.x, (int) pos.y);
if (startLandObject == null)
{
OSSLShoutError("There is no land at that location");
return;
}
if (!World.Permissions.CanEditParcel(m_host.OwnerID, startLandObject))
{
OSSLShoutError("You do not have permission to modify the parcel");
return;
}
// Create a new land data object we can modify
// Process the rules, not sure what the impact would be of changing owner or group
for (int idx = 0; idx < rules.Length;)
{
int code = rules.GetLSLIntegerItem(idx++);
string arg = rules.GetLSLStringItem(idx++);
UUID uuid;
switch (code)
{
case 0:
startLandObject.LandData.Name = arg;
break;
case 1:
startLandObject.LandData.Description = arg;
break;
case 2:
if (
!ScriptProtection.CheckThreatLevel(ThreatLevel.VeryHigh, "osSetParcelDetails", m_host,
"OSSL", m_itemID)) return;
if (UUID.TryParse(arg, out uuid))
startLandObject.LandData.OwnerID = uuid;
break;
case 3:
if (
!ScriptProtection.CheckThreatLevel(ThreatLevel.VeryHigh, "osSetParcelDetails", m_host,
"OSSL", m_itemID)) return;
if (UUID.TryParse(arg, out uuid))
startLandObject.LandData.GroupID = uuid;
break;
}
}
parcelManagement.UpdateLandObject(startLandObject);
}
}
示例3: 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_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)
{
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(CultureInfo.InvariantCulture) + "\n" + notecardData + "}\n";
asset.Data = Util.UTF8.GetBytes(notecardData);
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);
}
示例4: ConvertLSLToWindlight
//.........这里部分代码省略.........
break;
}
case ScriptBaseClass.WL_SKY_GLOW: {
LSL_Rotation rot = list.GetQuaternionItem (i + 1);
skyData.glow = rot.ToVector4 ();
break;
}
case ScriptBaseClass.WL_SKY_HAZE_DENSITY: {
LSL_Rotation rot = list.GetQuaternionItem (i + 1);
skyData.haze_density = rot.ToVector4 ();
break;
}
case ScriptBaseClass.WL_SKY_HAZE_HORIZON: {
LSL_Rotation rot = list.GetQuaternionItem (i + 1);
skyData.haze_horizon = rot.ToVector4 ();
break;
}
case ScriptBaseClass.WL_SKY_LIGHT_NORMALS: {
LSL_Rotation rot = list.GetQuaternionItem (i + 1);
skyData.lightnorm = rot.ToVector4 ();
break;
}
case ScriptBaseClass.WL_SKY_MAX_ALTITUDE: {
LSL_Rotation rot = list.GetQuaternionItem (i + 1);
skyData.max_y = rot.ToVector4 ();
break;
}
case ScriptBaseClass.WL_SKY_STAR_BRIGHTNESS: {
LSL_Float f = list.GetLSLFloatItem (i + 1);
skyData.star_brightness = (float)f.value;
break;
}
case ScriptBaseClass.WL_SKY_SUNLIGHT_COLOR: {
LSL_Rotation rot = list.GetQuaternionItem (i + 1);
skyData.sunlight_color = rot.ToVector4 ();
break;
}
case ScriptBaseClass.WL_WATER_BIG_WAVE_DIRECTION: {
var rot = list.GetVector3Item (i + 1);
cycle.Water.wave1Dir = new Vector2 ((float)rot.x.value, (float)rot.y.value);
break;
}
case ScriptBaseClass.WL_WATER_BLUR_MULTIPLIER: {
var f = list.GetLSLFloatItem (i + 1);
cycle.Water.blurMultiplier = (float)f.value;
break;
}
case ScriptBaseClass.WL_WATER_FOG_COLOR: {
LSL_Rotation rot = list.GetQuaternionItem (i + 1);
cycle.Water.waterFogColor = rot.ToVector4 ();
break;
}
case ScriptBaseClass.WL_WATER_FOG_DENSITY: {
var f = list.GetLSLFloatItem (i + 1);
cycle.Water.waterFogDensity = (float)f.value;
break;
}
case ScriptBaseClass.WL_WATER_FRESNEL_OFFSET: {
var f = list.GetLSLFloatItem (i + 1);
cycle.Water.fresnelOffset = (float)f.value;
break;
}
case ScriptBaseClass.WL_WATER_FRESNEL_SCALE: {
var f = list.GetLSLFloatItem (i + 1);
cycle.Water.fresnelScale = (float)f.value;
break;
}
case ScriptBaseClass.WL_WATER_LITTLE_WAVE_DIRECTION: {
var rot = list.GetVector3Item (i + 1);
cycle.Water.wave2Dir = new Vector2 ((float)rot.x.value, (float)rot.y.value);
break;
}
case ScriptBaseClass.WL_WATER_NORMAL_MAP: {
var f = list.GetLSLStringItem (i + 1);
cycle.Water.normalMap = UUID.Parse (f.m_string);
break;
}
case ScriptBaseClass.WL_WATER_NORMAL_SCALE: {
LSL_Vector rot = list.GetVector3Item (i + 1);
cycle.Water.normScale = rot.ToVector3 ();
break;
}
case ScriptBaseClass.WL_WATER_SCALE_ABOVE: {
var f = list.GetLSLFloatItem (i + 1);
cycle.Water.scaleAbove = (float)f.value;
break;
}
case ScriptBaseClass.WL_WATER_SCALE_BELOW: {
var f = list.GetLSLFloatItem (i + 1);
cycle.Water.scaleBelow = (float)f.value;
break;
}
case ScriptBaseClass.WL_WATER_UNDERWATER_FOG_MODIFIER: {
var f = list.GetLSLFloatItem (i + 1);
cycle.Water.underWaterFogMod = (float)f.value;
break;
}
}
}
}
示例5: aaSerializeXML
public LSL_String aaSerializeXML (LSL_List keys, LSL_List values)
{
if (!ScriptProtection.CheckThreatLevel (ThreatLevel.Moderate, "aaSerializeXML", m_host, "AA", m_itemID))
return new LSL_String ();
XmlDocument doc = new XmlDocument ();
for (int i = 0; i < keys.Length; i++) {
string key = keys.GetLSLStringItem (i);
string value = values.GetLSLStringItem (i);
XmlNode node = doc.CreateNode (XmlNodeType.Element, key, "");
node.InnerText = value;
doc.AppendChild (node);
}
return new LSL_String (doc.OuterXml);
}
示例6: SetParticleSystem
//.........这里部分代码省略.........
else if (rule == (int)ScriptBaseClass.PSYS_SRC_OUTERANGLE)
{
tempf = (float)rules.GetLSLFloatItem(i + 1);
prules.OuterAngle = tempf;
prules.PartFlags &= 0xFFFFFFFD; // Make sure new angle format is off.
}
else if (rule == (int)ScriptBaseClass.PSYS_PART_BLEND_FUNC_SOURCE)
{
tmpi = (int)rules.GetLSLIntegerItem(i + 1);
prules.BlendFuncSource = (byte)tmpi;
}
else if (rule == (int)ScriptBaseClass.PSYS_PART_BLEND_FUNC_DEST)
{
tmpi = (int)rules.GetLSLIntegerItem(i + 1);
prules.BlendFuncDest = (byte)tmpi;
}
else if (rule == (int)ScriptBaseClass.PSYS_PART_START_GLOW)
{
tempf = (float)rules.GetLSLFloatItem(i + 1);
prules.PartStartGlow = (float)tempf;
}
else if (rule == (int)ScriptBaseClass.PSYS_PART_END_GLOW)
{
tempf = (float)rules.GetLSLFloatItem(i + 1);
prules.PartEndGlow = (float)tempf;
}
else if (rule == (int)ScriptBaseClass.PSYS_SRC_TEXTURE)
{
prules.Texture = KeyOrName(rules.GetLSLStringItem(i + 1), AssetType.Texture, false);
}
else if (rule == (int)ScriptBaseClass.PSYS_SRC_BURST_RATE)
{
tempf = (float)rules.GetLSLFloatItem(i + 1);
prules.BurstRate = tempf;
}
else if (rule == (int)ScriptBaseClass.PSYS_SRC_BURST_PART_COUNT)
{
prules.BurstPartCount = (byte)(int)rules.GetLSLIntegerItem(i + 1);
}
else if (rule == (int)ScriptBaseClass.PSYS_SRC_BURST_RADIUS)
{
tempf = (float)rules.GetLSLFloatItem(i + 1);
prules.BurstRadius = tempf;
}
else if (rule == (int)ScriptBaseClass.PSYS_SRC_BURST_SPEED_MIN)
{
tempf = (float)rules.GetLSLFloatItem(i + 1);
prules.BurstSpeedMin = tempf;
}
else if (rule == (int)ScriptBaseClass.PSYS_SRC_BURST_SPEED_MAX)
{
tempf = (float)rules.GetLSLFloatItem(i + 1);
prules.BurstSpeedMax = tempf;
}
else if (rule == (int)ScriptBaseClass.PSYS_SRC_MAX_AGE)
示例7: SetPrimParams
//.........这里部分代码省略.........
string phy = rules.Data[idx++].ToString();
m_host.ParentEntity.ScriptSetPhysicsStatus(phy.Equals("1"));
}
else if (code == (int)ScriptBaseClass.PRIM_TEMP_ON_REZ)
{
if (remain < 1)
return;
if (!(part is ISceneChildEntity))
return;
string temp = rules.Data[idx++].ToString();
bool tempOnRez = temp.Equals("1");
(part as ISceneChildEntity).ScriptSetTemporaryStatus(tempOnRez);
}
else if (code == (int)ScriptBaseClass.PRIM_TEXGEN)
{
if (remain < 2)
return;
if (!(part is ISceneChildEntity))
return;
//face,type
face = rules.GetLSLIntegerItem(idx++);
int style = rules.GetLSLIntegerItem(idx++);
SetTexGen((part as ISceneChildEntity), face, style);
}
else if (code == (int)ScriptBaseClass.PRIM_TEXT)
{
if (remain < 3)
return;
if (!(part is ISceneChildEntity))
return;
string primText = rules.GetLSLStringItem(idx++);
LSL_Vector primTextColor = rules.GetVector3Item(idx++);
LSL_Float primTextAlpha = rules.GetLSLFloatItem(idx++);
Vector3 av3 = new Vector3(Util.Clip((float)primTextColor.x, 0.0f, 1.0f),
Util.Clip((float)primTextColor.y, 0.0f, 1.0f),
Util.Clip((float)primTextColor.z, 0.0f, 1.0f));
(part as ISceneChildEntity).SetText(primText, av3, Util.Clip((float)primTextAlpha, 0.0f, 1.0f));
}
else if (code == (int)ScriptBaseClass.PRIM_OMEGA)
{
if (remain < 3)
return;
LSL_Vector direction = rules.GetVector3Item(idx++);
LSL_Float spinrate = rules.GetLSLFloatItem(idx++);
LSL_Float gain = rules.GetLSLFloatItem(idx++);
if (part is ISceneChildEntity)
llTargetOmega(direction, spinrate, gain);
}
else if (code == (int)ScriptBaseClass.PRIM_PHYSICS_SHAPE_TYPE)
{
bool UsePhysics = ((m_host.Flags & PrimFlags.Physics) != 0);
bool IsTemporary = ((m_host.Flags & PrimFlags.TemporaryOnRez) != 0);
bool IsPhantom = ((m_host.Flags & PrimFlags.Phantom) != 0);
bool IsVolumeDetect = m_host.VolumeDetectActive;
ObjectFlagUpdatePacket.ExtraPhysicsBlock[] blocks = new ObjectFlagUpdatePacket.ExtraPhysicsBlock[1];
blocks[0] = new ObjectFlagUpdatePacket.ExtraPhysicsBlock
{
Density = m_host.Density,
Friction = m_host.Friction,
GravityMultiplier = m_host.GravityMultiplier
};
LSL_Integer shapeType = rules.GetLSLIntegerItem(idx++);
if (shapeType == ScriptBaseClass.PRIM_PHYSICS_SHAPE_PRIM)
示例8: SetPrimMediaParams
public LSL_Integer SetPrimMediaParams(ISceneChildEntity obj, int face, LSL_List rules)
{
IMoapModule module = World.RequestModuleInterface<IMoapModule>();
if (null == module)
throw new Exception("Media on a prim functions not available");
MediaEntry me = module.GetMediaEntry(obj, face) ?? new MediaEntry();
int i = 0;
while (i < rules.Length - 1)
{
int code = rules.GetLSLIntegerItem(i++);
if (code == ScriptBaseClass.PRIM_MEDIA_ALT_IMAGE_ENABLE)
{
me.EnableAlterntiveImage = (rules.GetLSLIntegerItem(i++) != 0);
}
else if (code == ScriptBaseClass.PRIM_MEDIA_CONTROLS)
{
int v = rules.GetLSLIntegerItem(i++);
me.Controls = ScriptBaseClass.PRIM_MEDIA_CONTROLS_STANDARD == v
? MediaControls.Standard
: MediaControls.Mini;
}
else if (code == ScriptBaseClass.PRIM_MEDIA_CURRENT_URL)
{
me.CurrentURL = rules.GetLSLStringItem(i++);
}
else if (code == ScriptBaseClass.PRIM_MEDIA_HOME_URL)
{
me.HomeURL = rules.GetLSLStringItem(i++);
}
else if (code == ScriptBaseClass.PRIM_MEDIA_AUTO_LOOP)
{
me.AutoLoop = (ScriptBaseClass.TRUE == rules.GetLSLIntegerItem(i++));
}
else if (code == ScriptBaseClass.PRIM_MEDIA_AUTO_PLAY)
{
me.AutoPlay = (ScriptBaseClass.TRUE == rules.GetLSLIntegerItem(i++));
}
else if (code == ScriptBaseClass.PRIM_MEDIA_AUTO_SCALE)
{
me.AutoScale = (ScriptBaseClass.TRUE == rules.GetLSLIntegerItem(i++));
}
else if (code == ScriptBaseClass.PRIM_MEDIA_AUTO_ZOOM)
{
me.AutoZoom = (ScriptBaseClass.TRUE == rules.GetLSLIntegerItem(i++));
}
else if (code == ScriptBaseClass.PRIM_MEDIA_FIRST_CLICK_INTERACT)
{
me.InteractOnFirstClick = (ScriptBaseClass.TRUE == rules.GetLSLIntegerItem(i++));
}
else if (code == ScriptBaseClass.PRIM_MEDIA_WIDTH_PIXELS)
{
me.Width = rules.GetLSLIntegerItem(i++);
}
else if (code == ScriptBaseClass.PRIM_MEDIA_HEIGHT_PIXELS)
{
me.Height = rules.GetLSLIntegerItem(i++);
}
else if (code == ScriptBaseClass.PRIM_MEDIA_WHITELIST_ENABLE)
{
me.EnableWhiteList = (ScriptBaseClass.TRUE == rules.GetLSLIntegerItem(i++));
}
else if (code == ScriptBaseClass.PRIM_MEDIA_WHITELIST)
{
string[] rawWhiteListUrls = rules.GetLSLStringItem(i++).ToString().Split(new[] { ',' });
List<string> whiteListUrls = new List<string>();
Array.ForEach(
rawWhiteListUrls, rawUrl => whiteListUrls.Add(rawUrl.Trim()));
me.WhiteList = whiteListUrls.ToArray();
}
else if (code == ScriptBaseClass.PRIM_MEDIA_PERMS_INTERACT)
{
me.InteractPermissions = (MediaPermission)(byte)(int)rules.GetLSLIntegerItem(i++);
}
else if (code == ScriptBaseClass.PRIM_MEDIA_PERMS_CONTROL)
{
me.ControlPermissions = (MediaPermission)(byte)(int)rules.GetLSLIntegerItem(i++);
}
}
module.SetMediaEntry(obj, face, me);
return ScriptBaseClass.STATUS_OK;
}