本文整理汇总了C#中OpenSim.Region.ScriptEngine.Shared.LSL_Types.list.GetLSLStringItem方法的典型用法代码示例。如果您正苦于以下问题:C# OpenSim.Region.ScriptEngine.Shared.LSL_Types.list.GetLSLStringItem方法的具体用法?C# OpenSim.Region.ScriptEngine.Shared.LSL_Types.list.GetLSLStringItem怎么用?C# OpenSim.Region.ScriptEngine.Shared.LSL_Types.list.GetLSLStringItem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenSim.Region.ScriptEngine.Shared.LSL_Types.list
的用法示例。
在下文中一共展示了OpenSim.Region.ScriptEngine.Shared.LSL_Types.list.GetLSLStringItem方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetParcelDetails
private void SetParcelDetails(LSL_Vector pos, LSL_List rules, string functionName)
{
m_host.AddScriptLPS(1);
// Get a reference to the land data and make sure the owner of the script
// can modify it
ILandObject startLandObject = World.LandChannel.GetLandObject((int)pos.x, (int)pos.y);
if (startLandObject == null)
{
OSSLShoutError("There is no land at that location");
return;
}
if (!World.Permissions.CanEditParcelProperties(m_host.OwnerID, startLandObject, GroupPowers.LandOptions, false))
{
OSSLShoutError("You do not have permission to modify the parcel");
return;
}
// Create a new land data object we can modify
LandData newLand = startLandObject.LandData.Copy();
UUID uuid;
// 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++);
switch (code)
{
case ScriptBaseClass.PARCEL_DETAILS_NAME:
newLand.Name = arg;
break;
case ScriptBaseClass.PARCEL_DETAILS_DESC:
newLand.Description = arg;
break;
case ScriptBaseClass.PARCEL_DETAILS_OWNER:
CheckThreatLevel(ThreatLevel.VeryHigh, functionName);
if (UUID.TryParse(arg, out uuid))
newLand.OwnerID = uuid;
break;
case ScriptBaseClass.PARCEL_DETAILS_GROUP:
CheckThreatLevel(ThreatLevel.VeryHigh, functionName);
if (UUID.TryParse(arg, out uuid))
newLand.GroupID = uuid;
break;
case ScriptBaseClass.PARCEL_DETAILS_CLAIMDATE:
CheckThreatLevel(ThreatLevel.VeryHigh, functionName);
newLand.ClaimDate = Convert.ToInt32(arg);
if (newLand.ClaimDate == 0)
newLand.ClaimDate = Util.UnixTimeSinceEpoch();
break;
}
}
World.LandChannel.UpdateLandObject(newLand.LocalID,newLand);
}
示例2: SetPrimMediaParams
private LSL_Integer SetPrimMediaParams(SceneObjectPart part, LSL_Integer face, LSL_List rules)
{
// LSL Spec http://wiki.secondlife.com/wiki/LlSetPrimMediaParams says to fail silently if face is invalid
// Assuming silently fail means sending back LSL_STATUS_OK. Ideally, need to check this.
// Don't perform the media check directly
if (face < 0 || face > part.GetNumberOfSides() - 1)
return ScriptBaseClass.LSL_STATUS_NOT_FOUND;
IMoapModule module = m_ScriptEngine.World.RequestModuleInterface<IMoapModule>();
if (null == module)
return ScriptBaseClass.LSL_STATUS_NOT_SUPPORTED;
MediaEntry me = module.GetMediaEntry(part, face);
if (null == me)
me = new MediaEntry();
int i = 0;
while (i < rules.Length - 1)
{
int code = rules.GetLSLIntegerItem(i++);
switch (code)
{
case ScriptBaseClass.PRIM_MEDIA_ALT_IMAGE_ENABLE:
me.EnableAlterntiveImage = (rules.GetLSLIntegerItem(i++) != 0 ? true : false);
break;
case ScriptBaseClass.PRIM_MEDIA_CONTROLS:
int v = rules.GetLSLIntegerItem(i++);
if (ScriptBaseClass.PRIM_MEDIA_CONTROLS_STANDARD == v)
me.Controls = MediaControls.Standard;
else
me.Controls = MediaControls.Mini;
break;
case ScriptBaseClass.PRIM_MEDIA_CURRENT_URL:
me.CurrentURL = rules.GetLSLStringItem(i++);
break;
case ScriptBaseClass.PRIM_MEDIA_HOME_URL:
me.HomeURL = rules.GetLSLStringItem(i++);
break;
case ScriptBaseClass.PRIM_MEDIA_AUTO_LOOP:
me.AutoLoop = (ScriptBaseClass.TRUE == rules.GetLSLIntegerItem(i++) ? true : false);
break;
case ScriptBaseClass.PRIM_MEDIA_AUTO_PLAY:
me.AutoPlay = (ScriptBaseClass.TRUE == rules.GetLSLIntegerItem(i++) ? true : false);
break;
case ScriptBaseClass.PRIM_MEDIA_AUTO_SCALE:
me.AutoScale = (ScriptBaseClass.TRUE == rules.GetLSLIntegerItem(i++) ? true : false);
break;
case ScriptBaseClass.PRIM_MEDIA_AUTO_ZOOM:
me.AutoZoom = (ScriptBaseClass.TRUE == rules.GetLSLIntegerItem(i++) ? true : false);
break;
case ScriptBaseClass.PRIM_MEDIA_FIRST_CLICK_INTERACT:
me.InteractOnFirstClick = (ScriptBaseClass.TRUE == rules.GetLSLIntegerItem(i++) ? true : false);
break;
case ScriptBaseClass.PRIM_MEDIA_WIDTH_PIXELS:
me.Width = (int)rules.GetLSLIntegerItem(i++);
break;
case ScriptBaseClass.PRIM_MEDIA_HEIGHT_PIXELS:
me.Height = (int)rules.GetLSLIntegerItem(i++);
break;
case ScriptBaseClass.PRIM_MEDIA_WHITELIST_ENABLE:
me.EnableWhiteList = (ScriptBaseClass.TRUE == rules.GetLSLIntegerItem(i++) ? true : false);
break;
case ScriptBaseClass.PRIM_MEDIA_WHITELIST:
string[] rawWhiteListUrls = rules.GetLSLStringItem(i++).ToString().Split(new char[] { ',' });
List<string> whiteListUrls = new List<string>();
Array.ForEach(
rawWhiteListUrls, delegate(string rawUrl) { whiteListUrls.Add(rawUrl.Trim()); });
me.WhiteList = whiteListUrls.ToArray();
break;
case ScriptBaseClass.PRIM_MEDIA_PERMS_INTERACT:
me.InteractPermissions = (MediaPermission)(byte)(int)rules.GetLSLIntegerItem(i++);
break;
case ScriptBaseClass.PRIM_MEDIA_PERMS_CONTROL:
me.ControlPermissions = (MediaPermission)(byte)(int)rules.GetLSLIntegerItem(i++);
break;
default: return ScriptBaseClass.LSL_STATUS_MALFORMED_PARAMS;
}
}
module.SetMediaEntry(part, face, me);
return ScriptBaseClass.LSL_STATUS_OK;
}
示例3: osDrawPolygon
public string osDrawPolygon(string drawList, LSL_List x, LSL_List y)
{
CheckThreatLevel(ThreatLevel.None, "osDrawPolygon");
m_host.AddScriptLPS(1);
if (x.Length != y.Length || x.Length < 3)
{
return "";
}
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 drawList;
}
示例4: SetParticleSystem
private void SetParticleSystem(SceneObjectPart part, LSL_List rules) {
if (rules.Length == 0)
{
part.RemoveParticleSystem();
part.ParentGroup.HasGroupChanged = true;
}
else
{
Primitive.ParticleSystem prules = getNewParticleSystemWithSLDefaultValues();
LSL_Vector tempv = new LSL_Vector();
float tempf = 0;
for (int i = 0; i < rules.Length; i += 2)
{
switch (rules.GetLSLIntegerItem(i))
{
case (int)ScriptBaseClass.PSYS_PART_FLAGS:
prules.PartDataFlags = (Primitive.ParticleSystem.ParticleDataFlags)(uint)rules.GetLSLIntegerItem(i + 1);
break;
case (int)ScriptBaseClass.PSYS_PART_START_COLOR:
tempv = rules.GetVector3Item(i + 1);
prules.PartStartColor.R = (float)tempv.x;
prules.PartStartColor.G = (float)tempv.y;
prules.PartStartColor.B = (float)tempv.z;
break;
case (int)ScriptBaseClass.PSYS_PART_START_ALPHA:
tempf = (float)rules.GetLSLFloatItem(i + 1);
prules.PartStartColor.A = tempf;
break;
case (int)ScriptBaseClass.PSYS_PART_END_COLOR:
tempv = rules.GetVector3Item(i + 1);
prules.PartEndColor.R = (float)tempv.x;
prules.PartEndColor.G = (float)tempv.y;
prules.PartEndColor.B = (float)tempv.z;
break;
case (int)ScriptBaseClass.PSYS_PART_END_ALPHA:
tempf = (float)rules.GetLSLFloatItem(i + 1);
prules.PartEndColor.A = tempf;
break;
case (int)ScriptBaseClass.PSYS_PART_START_SCALE:
tempv = rules.GetVector3Item(i + 1);
prules.PartStartScaleX = (float)tempv.x;
prules.PartStartScaleY = (float)tempv.y;
break;
case (int)ScriptBaseClass.PSYS_PART_END_SCALE:
tempv = rules.GetVector3Item(i + 1);
prules.PartEndScaleX = (float)tempv.x;
prules.PartEndScaleY = (float)tempv.y;
break;
case (int)ScriptBaseClass.PSYS_PART_MAX_AGE:
tempf = (float)rules.GetLSLFloatItem(i + 1);
prules.PartMaxAge = tempf;
break;
case (int)ScriptBaseClass.PSYS_SRC_ACCEL:
tempv = rules.GetVector3Item(i + 1);
prules.PartAcceleration.X = (float)tempv.x;
prules.PartAcceleration.Y = (float)tempv.y;
prules.PartAcceleration.Z = (float)tempv.z;
break;
case (int)ScriptBaseClass.PSYS_SRC_PATTERN:
int tmpi = (int)rules.GetLSLIntegerItem(i + 1);
prules.Pattern = (Primitive.ParticleSystem.SourcePattern)tmpi;
break;
// PSYS_SRC_INNERANGLE and PSYS_SRC_ANGLE_BEGIN use the same variables. The
// PSYS_SRC_OUTERANGLE and PSYS_SRC_ANGLE_END also use the same variable. The
// client tells the difference between the two by looking at the 0x02 bit in
// the PartFlags variable.
case (int)ScriptBaseClass.PSYS_SRC_INNERANGLE:
tempf = (float)rules.GetLSLFloatItem(i + 1);
prules.InnerAngle = (float)tempf;
prules.PartFlags &= 0xFFFFFFFD; // Make sure new angle format is off.
break;
case (int)ScriptBaseClass.PSYS_SRC_OUTERANGLE:
tempf = (float)rules.GetLSLFloatItem(i + 1);
prules.OuterAngle = (float)tempf;
prules.PartFlags &= 0xFFFFFFFD; // Make sure new angle format is off.
break;
case (int)ScriptBaseClass.PSYS_SRC_TEXTURE:
prules.Texture = KeyOrName(rules.GetLSLStringItem(i + 1));
break;
case (int)ScriptBaseClass.PSYS_SRC_BURST_RATE:
tempf = (float)rules.GetLSLFloatItem(i + 1);
prules.BurstRate = (float)tempf;
break;
//.........这里部分代码省略.........
示例5: SetPrimParams
//.........这里部分代码省略.........
case (int)ScriptBaseClass.PRIM_PHYSICS:
if (remain < 1)
return;
string phy = rules.Data[idx++].ToString();
bool physics;
if (phy.Equals("1"))
physics = true;
else
physics = false;
part.ScriptSetPhysicsStatus(physics);
break;
case (int)ScriptBaseClass.PRIM_TEMP_ON_REZ:
if (remain < 1)
return;
string temp = rules.Data[idx++].ToString();
m_host.ParentGroup.ScriptSetTemporaryStatus(temp.Equals("1"));
break;
case (int)ScriptBaseClass.PRIM_TEXGEN:
if (remain < 2)
return;
//face,type
face = rules.GetLSLIntegerItem(idx++);
int style = rules.GetLSLIntegerItem(idx++);
SetTexGen(part, face, style);
break;
case (int)ScriptBaseClass.PRIM_TEXT:
if (remain < 3)
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.SetText(primText, av3, Util.Clip((float)primTextAlpha, 0.0f, 1.0f));
break;
case (int)ScriptBaseClass.PRIM_NAME:
if (remain < 1)
return;
string primName = rules.GetLSLStringItem(idx++);
part.Name = primName;
break;
case (int)ScriptBaseClass.PRIM_DESC:
if (remain < 1)
return;
string primDesc = rules.GetLSLStringItem(idx++);
part.Description = primDesc;
break;
case (int)ScriptBaseClass.PRIM_ROT_LOCAL:
if (remain < 1)
return;
LSL_Rotation lr = rules.GetQuaternionItem(idx++);
SetRot(part, Rot2Quaternion(lr));
break;
case (int)ScriptBaseClass.PRIM_OMEGA:
if (remain < 3)
return;
LSL_Vector axis = rules.GetVector3Item(idx++);
LSL_Float spinrate = rules.GetLSLFloatItem(idx++);
LSL_Float gain = rules.GetLSLFloatItem(idx++);
TargetOmega(part, axis, (double)spinrate, (double)gain);
break;
case (int)ScriptBaseClass.PRIM_LINK_TARGET:
if (remain < 3) // setting to 3 on the basis that parsing any usage of PRIM_LINK_TARGET that has nothing following it is pointless.
return;
LSL_Integer new_linknumber = rules.GetLSLIntegerItem(idx++);
LSL_List new_rules = rules.GetSublist(idx, -1);
setLinkPrimParams((int)new_linknumber, new_rules);
return;
}
}
}
finally
{
if (positionChanged)
{
if (part.ParentGroup.RootPart == part)
{
SceneObjectGroup parent = part.ParentGroup;
parent.UpdateGroupPosition(new Vector3((float)currentPosition.x, (float)currentPosition.y, (float)currentPosition.z));
}
else
{
part.OffsetPosition = new Vector3((float)currentPosition.x, (float)currentPosition.y, (float)currentPosition.z);
SceneObjectGroup parent = part.ParentGroup;
parent.HasGroupChanged = true;
parent.ScheduleGroupForTerseUpdate();
}
}
}
}
示例6: SetPrimParams
//.........这里部分代码省略.........
return;
face = rules.GetLSLIntegerItem(idx++);
bool st = rules.GetLSLIntegerItem(idx++);
SetFullBright(part, face , st);
break;
case (int)ScriptBaseClass.PRIM_MATERIAL:
if (remain < 1)
return;
int mat = rules.GetLSLIntegerItem(idx++);
if (mat < 0 || mat > 7)
return;
part.Material = Convert.ToByte(mat);
break;
case (int)ScriptBaseClass.PRIM_PHANTOM:
if (remain < 1)
return;
string ph = rules.Data[idx++].ToString();
bool phantom;
if (ph.Equals("1"))
phantom = true;
else
phantom = false;
part.ScriptSetPhantomStatus(phantom);
break;
case (int)ScriptBaseClass.PRIM_PHYSICS:
if (remain < 1)
return;
string phy = rules.Data[idx++].ToString();
bool physics;
if (phy.Equals("1"))
physics = true;
else
physics = false;
part.ScriptSetPhysicsStatus(physics);
break;
case (int)ScriptBaseClass.PRIM_TEMP_ON_REZ:
if (remain < 1)
return;
string temp = rules.Data[idx++].ToString();
bool tempOnRez;
if (temp.Equals("1"))
tempOnRez = true;
else
tempOnRez = false;
part.ScriptSetTemporaryStatus(tempOnRez);
break;
case (int)ScriptBaseClass.PRIM_TEXGEN:
if (remain < 2)
return;
//face,type
face = rules.GetLSLIntegerItem(idx++);
int style = rules.GetLSLIntegerItem(idx++);
SetTexGen(part, face, style);
break;
case (int)ScriptBaseClass.PRIM_TEXT:
if (remain < 3)
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.SetText(primText, av3, Util.Clip((float)primTextAlpha, 0.0f, 1.0f));
break;
case (int)ScriptBaseClass.PRIM_NAME:
if (remain < 1)
return;
string primName = rules.GetLSLStringItem(idx++);
part.Name = primName;
break;
case (int)ScriptBaseClass.PRIM_DESC:
if (remain < 1)
return;
string primDesc = rules.GetLSLStringItem(idx++);
part.Description = primDesc;
break;
case (int)ScriptBaseClass.PRIM_ROT_LOCAL:
if (remain < 1)
return;
LSL_Rotation lr = rules.GetQuaternionItem(idx++);
SetRot(part, Rot2Quaternion(lr));
break;
}
}
}
示例7: SetPrimMediaParams
private LSL_Integer SetPrimMediaParams(int face, LSL_List rules)
{
IMoapModule module = m_ScriptEngine.World.RequestModuleInterface<IMoapModule>();
if (null == module)
throw new Exception("Media on a prim functions not available");
MediaEntry me = module.GetMediaEntry(m_host, face);
if (null == me)
me = new MediaEntry();
int i = 0;
while (i < rules.Length - 1)
{
int code = rules.GetLSLIntegerItem(i++);
switch (code)
{
case ScriptBaseClass.PRIM_MEDIA_ALT_IMAGE_ENABLE:
me.EnableAlterntiveImage = (rules.GetLSLIntegerItem(i++) != 0 ? true : false);
break;
case ScriptBaseClass.PRIM_MEDIA_CONTROLS:
int v = rules.GetLSLIntegerItem(i++);
if (ScriptBaseClass.PRIM_MEDIA_CONTROLS_STANDARD == v)
me.Controls = MediaControls.Standard;
else
me.Controls = MediaControls.Mini;
break;
case ScriptBaseClass.PRIM_MEDIA_CURRENT_URL:
me.CurrentURL = rules.GetLSLStringItem(i++);
break;
case ScriptBaseClass.PRIM_MEDIA_HOME_URL:
me.HomeURL = rules.GetLSLStringItem(i++);
break;
case ScriptBaseClass.PRIM_MEDIA_AUTO_LOOP:
me.AutoLoop = (ScriptBaseClass.TRUE == rules.GetLSLIntegerItem(i++) ? true : false);
break;
case ScriptBaseClass.PRIM_MEDIA_AUTO_PLAY:
me.AutoPlay = (ScriptBaseClass.TRUE == rules.GetLSLIntegerItem(i++) ? true : false);
break;
case ScriptBaseClass.PRIM_MEDIA_AUTO_SCALE:
me.AutoScale = (ScriptBaseClass.TRUE == rules.GetLSLIntegerItem(i++) ? true : false);
break;
case ScriptBaseClass.PRIM_MEDIA_AUTO_ZOOM:
me.AutoZoom = (ScriptBaseClass.TRUE == rules.GetLSLIntegerItem(i++) ? true : false);
break;
case ScriptBaseClass.PRIM_MEDIA_FIRST_CLICK_INTERACT:
me.InteractOnFirstClick = (ScriptBaseClass.TRUE == rules.GetLSLIntegerItem(i++) ? true : false);
break;
case ScriptBaseClass.PRIM_MEDIA_WIDTH_PIXELS:
me.Width = (int)rules.GetLSLIntegerItem(i++);
break;
case ScriptBaseClass.PRIM_MEDIA_HEIGHT_PIXELS:
me.Height = (int)rules.GetLSLIntegerItem(i++);
break;
case ScriptBaseClass.PRIM_MEDIA_WHITELIST_ENABLE:
me.EnableWhiteList = (ScriptBaseClass.TRUE == rules.GetLSLIntegerItem(i++) ? true : false);
break;
case ScriptBaseClass.PRIM_MEDIA_WHITELIST:
string[] rawWhiteListUrls = rules.GetLSLStringItem(i++).ToString().Split(new char[] { ',' });
List<string> whiteListUrls = new List<string>();
Array.ForEach(
rawWhiteListUrls, delegate(string rawUrl) { whiteListUrls.Add(rawUrl.Trim()); });
me.WhiteList = whiteListUrls.ToArray();
break;
case ScriptBaseClass.PRIM_MEDIA_PERMS_INTERACT:
me.InteractPermissions = (MediaPermission)(byte)(int)rules.GetLSLIntegerItem(i++);
break;
case ScriptBaseClass.PRIM_MEDIA_PERMS_CONTROL:
me.ControlPermissions = (MediaPermission)(byte)(int)rules.GetLSLIntegerItem(i++);
break;
}
}
module.SetMediaEntry(m_host, face, me);
return ScriptBaseClass.LSL_STATUS_OK;
}
示例8: getWindlightProfileFromRules
//.........这里部分代码省略.........
catch (InvalidCastException)
{
throw new InvalidCastException(string.Format("Error running rule WL_HORIZON: arg #{0} - parameter 1 must be rotation", idx));
}
wl.horizon = new Vector4((float)iQ.x, (float)iQ.y, (float)iQ.z, (float)iQ.s);
break;
case (int)ScriptBaseClass.WL_LITTLE_WAVE_DIRECTION:
idx++;
try
{
iV = rules.GetVector3Item(idx);
}
catch (InvalidCastException)
{
throw new InvalidCastException(string.Format("Error running rule WL_LITTLE_WAVE_DIRECTION: arg #{0} - parameter 1 must be vector", idx));
}
wl.littleWaveDirection = new Vector2((float)iV.x, (float)iV.y);
break;
case (int)ScriptBaseClass.WL_MAX_ALTITUDE:
idx++;
try
{
wl.maxAltitude = (ushort)rules.GetLSLIntegerItem(idx).value;
}
catch (InvalidCastException)
{
throw new InvalidCastException(string.Format("Error running rule WL_MAX_ALTITUDE: arg #{0} - parameter 1 must be integer", idx));
}
break;
case (int)ScriptBaseClass.WL_NORMAL_MAP_TEXTURE:
idx++;
try
{
wl.normalMapTexture = new UUID(rules.GetLSLStringItem(idx).m_string);
}
catch (ArgumentException)
{
throw new InvalidCastException(string.Format("Error running rule WL_NORMAL_MAP_TEXTURE: arg #{0} - parameter 1 must be key", idx));
}
break;
case (int)ScriptBaseClass.WL_REFLECTION_WAVELET_SCALE:
idx++;
try
{
iV = rules.GetVector3Item(idx);
}
catch (InvalidCastException)
{
throw new InvalidCastException(string.Format("Error running rule WL_REFLECTION_WAVELET_SCALE: arg #{0} - parameter 1 must be vector", idx));
}
wl.reflectionWaveletScale = iV;
break;
case (int)ScriptBaseClass.WL_REFRACT_SCALE_ABOVE:
idx++;
try
{
wl.refractScaleAbove = (float)rules.GetLSLFloatItem(idx);
}
catch (InvalidCastException)
{
throw new InvalidCastException(string.Format("Error running rule WL_REFRACT_SCALE_ABOVE: arg #{0} - parameter 1 must be float", idx));
}
break;
case (int)ScriptBaseClass.WL_REFRACT_SCALE_BELOW:
idx++;
try
示例9: llParticleSystem
public void llParticleSystem(LSL_List rules)
{
m_host.AddScriptLPS(1);
if (rules.Length == 0)
{
m_host.RemoveParticleSystem();
m_host.ParentGroup.HasGroupChanged = true;
}
else
{
Primitive.ParticleSystem prules = getNewParticleSystemWithSLDefaultValues();
LSL_Vector tempv = new LSL_Vector();
float tempf = 0;
for (int i = 0; i < rules.Length; i += 2)
{
switch ((int)rules.Data[i])
{
case (int)ScriptBaseClass.PSYS_PART_FLAGS:
prules.PartDataFlags = (Primitive.ParticleSystem.ParticleDataFlags)(uint)rules.GetLSLIntegerItem(i + 1);
break;
case (int)ScriptBaseClass.PSYS_PART_START_COLOR:
tempv = rules.GetVector3Item(i + 1);
prules.PartStartColor.R = (float)tempv.x;
prules.PartStartColor.G = (float)tempv.y;
prules.PartStartColor.B = (float)tempv.z;
break;
case (int)ScriptBaseClass.PSYS_PART_START_ALPHA:
tempf = (float)rules.GetLSLFloatItem(i + 1);
prules.PartStartColor.A = tempf;
break;
case (int)ScriptBaseClass.PSYS_PART_END_COLOR:
tempv = rules.GetVector3Item(i + 1);
prules.PartEndColor.R = (float)tempv.x;
prules.PartEndColor.G = (float)tempv.y;
prules.PartEndColor.B = (float)tempv.z;
break;
case (int)ScriptBaseClass.PSYS_PART_END_ALPHA:
tempf = (float)rules.GetLSLFloatItem(i + 1);
prules.PartEndColor.A = tempf;
break;
case (int)ScriptBaseClass.PSYS_PART_START_SCALE:
tempv = rules.GetVector3Item(i + 1);
prules.PartStartScaleX = (float)tempv.x;
prules.PartStartScaleY = (float)tempv.y;
break;
case (int)ScriptBaseClass.PSYS_PART_END_SCALE:
tempv = rules.GetVector3Item(i + 1);
prules.PartEndScaleX = (float)tempv.x;
prules.PartEndScaleY = (float)tempv.y;
break;
case (int)ScriptBaseClass.PSYS_PART_MAX_AGE:
tempf = (float)rules.GetLSLFloatItem(i + 1);
prules.PartMaxAge = tempf;
break;
case (int)ScriptBaseClass.PSYS_SRC_ACCEL:
tempv = rules.GetVector3Item(i + 1);
prules.PartAcceleration.X = (float)tempv.x;
prules.PartAcceleration.Y = (float)tempv.y;
prules.PartAcceleration.Z = (float)tempv.z;
break;
case (int)ScriptBaseClass.PSYS_SRC_PATTERN:
int tmpi = (int)rules.GetLSLIntegerItem(i + 1);
prules.Pattern = (Primitive.ParticleSystem.SourcePattern)tmpi;
break;
case (int)ScriptBaseClass.PSYS_SRC_TEXTURE:
prules.Texture = KeyOrName(rules.GetLSLStringItem(i + 1));
break;
case (int)ScriptBaseClass.PSYS_SRC_BURST_RATE:
tempf = (float)rules.GetLSLFloatItem(i + 1);
prules.BurstRate = (float)tempf;
break;
case (int)ScriptBaseClass.PSYS_SRC_BURST_PART_COUNT:
prules.BurstPartCount = (byte)(int)rules.GetLSLIntegerItem(i + 1);
break;
case (int)ScriptBaseClass.PSYS_SRC_BURST_RADIUS:
tempf = (float)rules.GetLSLFloatItem(i + 1);
prules.BurstRadius = (float)tempf;
break;
case (int)ScriptBaseClass.PSYS_SRC_BURST_SPEED_MIN:
tempf = (float)rules.GetLSLFloatItem(i + 1);
prules.BurstSpeedMin = (float)tempf;
break;
case (int)ScriptBaseClass.PSYS_SRC_BURST_SPEED_MAX:
//.........这里部分代码省略.........
示例10: SetPrimParams
//.........这里部分代码省略.........
return new LSL_List();
//face,type
int style;
try
{
face = rules.GetLSLIntegerItem(idx++);
}
catch(InvalidCastException)
{
Error(originFunc, string.Format("Error running rule #{0} -> PRIM_TEXGEN: arg #{1} - parameter 2 must be integer", rulesParsed, idx - idxStart - 1));
return new LSL_List();
}
try
{
style = rules.GetLSLIntegerItem(idx++);
}
catch(InvalidCastException)
{
Error(originFunc, string.Format("Error running rule #{0} -> PRIM_TEXGEN: arg #{1} - parameter 3 must be integer", rulesParsed, idx - idxStart - 1));
return new LSL_List();
}
SetTexGen(part, face, style);
break;
case ScriptBaseClass.PRIM_TEXT:
if (remain < 3)
return new LSL_List();
string primText;
LSL_Vector primTextColor;
LSL_Float primTextAlpha;
try
{
primText = rules.GetLSLStringItem(idx++);
}
catch(InvalidCastException)
{
Error(originFunc, string.Format("Error running rule #{0} -> PRIM_TEXT: arg #{1} - parameter 2 must be string", rulesParsed, idx - idxStart - 1));
return new LSL_List();
}
try
{
primTextColor = rules.GetVector3Item(idx++);
}
catch(InvalidCastException)
{
Error(originFunc, string.Format("Error running rule #{0} -> PRIM_TEXT: arg #{1} - parameter 3 must be vector", rulesParsed, idx - idxStart - 1));
return new LSL_List();
}
try
{
primTextAlpha = rules.GetLSLFloatItem(idx++);
}
catch(InvalidCastException)
{
Error(originFunc, string.Format("Error running rule #{0} -> PRIM_TEXT: arg #{1} - parameter 4 must be float", rulesParsed, idx - idxStart - 1));
return new LSL_List();
}
Vector3 av3 = Util.Clip(primTextColor, 0.0f, 1.0f);
part.SetText(primText, av3, Util.Clip((float)primTextAlpha, 0.0f, 1.0f));
break;
case ScriptBaseClass.PRIM_NAME:
if (remain < 1)
return new LSL_List();
示例11: SetParticleSystem
//.........这里部分代码省略.........
}
prules.BlendFuncDest = (byte)tmpi;
break;
case (int)ScriptBaseClass.PSYS_PART_START_GLOW:
try
{
tempf = (float)rules.GetLSLFloatItem(i + 1);
}
catch(InvalidCastException)
{
Error(originFunc, string.Format("Error running rule PSYS_PART_START_GLOW: arg #{0} - parameter 1 must be float", i + 1));
return;
}
prules.PartStartGlow = (float)tempf;
break;
case (int)ScriptBaseClass.PSYS_PART_END_GLOW:
try
{
tempf = (float)rules.GetLSLFloatItem(i + 1);
}
catch(InvalidCastException)
{
Error(originFunc, string.Format("Error running rule PSYS_PART_END_GLOW: arg #{0} - parameter 1 must be float", i + 1));
return;
}
prules.PartEndGlow = (float)tempf;
break;
case (int)ScriptBaseClass.PSYS_SRC_TEXTURE:
try
{
prules.Texture = ScriptUtils.GetAssetIdFromKeyOrItemName(m_host, rules.GetLSLStringItem(i + 1));
}
catch(InvalidCastException)
{
Error(originFunc, string.Format("Error running rule PSYS_SRC_TEXTURE: arg #{0} - parameter 1 must be string or key", i + 1));
return;
}
break;
case (int)ScriptBaseClass.PSYS_SRC_BURST_RATE:
try
{
tempf = (float)rules.GetLSLFloatItem(i + 1);
}
catch(InvalidCastException)
{
Error(originFunc, string.Format("Error running rule PSYS_SRC_BURST_RATE: arg #{0} - parameter 1 must be float", i + 1));
return;
}
prules.BurstRate = (float)tempf;
break;
case (int)ScriptBaseClass.PSYS_SRC_BURST_PART_COUNT:
try
{
prules.BurstPartCount = (byte)(int)rules.GetLSLIntegerItem(i + 1);
}
catch(InvalidCastException)
{
Error(originFunc, string.Format("Error running rule PSYS_SRC_BURST_PART_COUNT: arg #{0} - parameter 1 must be integer", i + 1));
return;
}
break;
示例12: osParcelSetDetails
public void osParcelSetDetails(LSL_Vector pos, LSL_List rules)
{
CheckThreatLevel(ThreatLevel.High, "osParcelSetDetails");
m_host.AddScriptLPS(1);
// Get a reference to the land data and make sure the owner of the script
// can modify it
ILandObject startLandObject = World.LandChannel.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
LandData newLand = startLandObject.LandData.Copy();
UUID uuid;
// 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++);
switch (code)
{
case 0:
newLand.Name = arg;
break;
case 1:
newLand.Description = arg;
break;
case 2:
CheckThreatLevel(ThreatLevel.VeryHigh, "osParcelSetDetails");
if (UUID.TryParse(arg , out uuid))
newLand.OwnerID = uuid;
break;
case 3:
CheckThreatLevel(ThreatLevel.VeryHigh, "osParcelSetDetails");
if (UUID.TryParse(arg , out uuid))
newLand.GroupID = uuid;
break;
}
}
World.LandChannel.UpdateLandObject(newLand.LocalID,newLand);
}
示例13: osRevokeScriptPermissions
public void osRevokeScriptPermissions(LSL_Key avatar, LSL_List osfunctions)
{
CheckThreatLevel(ThreatLevel.Impossible, "osRevokeScriptPermissions");
m_host.AddScriptLPS(1);
UUID key;
UUID.TryParse(avatar.m_string, out key);
for (int item = 0; item <= osfunctions.Length - 1; item++)
{
string function = osfunctions.GetLSLStringItem(item);
World.RemoveOsslPerm(key, function);
}
}
示例14: osDrawFilledPolygon
public string osDrawFilledPolygon(string drawList, LSL_List x, LSL_List y)
{
m_host.AddScriptLPS(1);
if (x.Length != y.Length || x.Length < 3)
{
return "";
}
drawList += "FillPolygon " + x.GetLSLStringItem(0) + "," + y.GetLSLStringItem(0);
for (int i = 1; i < x.Length; i++)
{
drawList += "," + x.GetLSLStringItem(i) + "," + y.GetLSLStringItem(i);
}
drawList += "; ";
return drawList;
}