本文整理汇总了C#中WhiteCore.ScriptEngine.DotNetEngine.LSL_Types.list类的典型用法代码示例。如果您正苦于以下问题:C# WhiteCore.ScriptEngine.DotNetEngine.LSL_Types.list类的具体用法?C# WhiteCore.ScriptEngine.DotNetEngine.LSL_Types.list怎么用?C# WhiteCore.ScriptEngine.DotNetEngine.LSL_Types.list使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WhiteCore.ScriptEngine.DotNetEngine.LSL_Types.list类属于命名空间,在下文中一共展示了WhiteCore.ScriptEngine.DotNetEngine.LSL_Types.list类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: llGetAgentList
/// <summary>
/// http://wiki.secondlife.com/wiki/LlGetAgentList
/// The list of options is currently not used in SL
/// scope is one of:-
/// AGENT_LIST_REGION - all in the region
/// AGENT_LIST_PARCEL - all in the same parcel as the scripted object
/// AGENT_LIST_PARCEL_OWNER - all in any parcel owned by the owner of the
/// current parcel.
/// </summary>
public LSL_List llGetAgentList(LSL_Integer scope, LSL_List options)
{
if (!ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL", m_itemID))
return new LSL_List();
// the constants are 1, 2 and 4 so bits are being set, but you
// get an error "INVALID_SCOPE" if it is anything but 1, 2 and 4
bool regionWide = scope == ScriptBaseClass.AGENT_LIST_REGION;
bool parcelOwned = scope == ScriptBaseClass.AGENT_LIST_PARCEL_OWNER;
bool parcel = scope == ScriptBaseClass.AGENT_LIST_PARCEL;
LSL_List result = new LSL_List();
if (!regionWide && !parcelOwned && !parcel)
{
result.Add("INVALID_SCOPE");
return result;
}
Vector3 pos;
UUID id = UUID.Zero;
if (parcel || parcelOwned)
{
pos = m_host.GetWorldPosition();
IParcelManagementModule parcelManagement = World.RequestModuleInterface<IParcelManagementModule>();
ILandObject land = parcelManagement.GetLandObject(pos.X, pos.Y);
if (land == null)
{
id = UUID.Zero;
}
else
{
if (parcelOwned)
{
id = land.LandData.OwnerID;
}
else
{
id = land.LandData.GlobalID;
}
}
}
World.ForEachScenePresence(
delegate(IScenePresence ssp) {
// Gods are not listed in SL
if (!ssp.IsDeleted && FloatAlmostEqual(ssp.GodLevel, 0.0) && !ssp.IsChildAgent) {
if (!regionWide) {
pos = ssp.AbsolutePosition;
IParcelManagementModule parcelManagement = World.RequestModuleInterface<IParcelManagementModule>();
ILandObject land = parcelManagement.GetLandObject(pos.X, pos.Y);
if (land != null) {
if (parcelOwned && land.LandData.OwnerID == id || parcel && land.LandData.GlobalID == id) {
result.Add(ssp.UUID.ToString());
}
}
} else {
result.Add(ssp.UUID.ToString());
}
}
// Maximum of 100 results
if (result.Length > 99)
{
return;
}
}
);
return result;
}
开发者ID:WhiteCoreSim,项目名称:WhiteCore-Dev,代码行数:79,代码来源:LSL_Api.cs
示例2: aaWindlightGetScene
public LSL_List aaWindlightGetScene(int dayCycleIndex, LSL_List rules)
{
IEnvironmentSettingsModule environmentSettings = World.RequestModuleInterface<IEnvironmentSettingsModule>();
if (environmentSettings == null)
return new LSL_List(new object[2] {ScriptBaseClass.WL_ERROR, ScriptBaseClass.WL_ERROR_NO_SCENE_SET});
WindlightDayCycle cycle = environmentSettings.GetCurrentDayCycle();
if (cycle == null)
return new LSL_List(new object[2] {ScriptBaseClass.WL_ERROR, ScriptBaseClass.WL_ERROR_NO_SCENE_SET});
if (cycle.Cycle.IsStaticDayCycle)
return
new LSL_List(new object[2]
{ScriptBaseClass.WL_ERROR, ScriptBaseClass.WL_ERROR_SCENE_MUST_NOT_BE_STATIC});
if (dayCycleIndex >= cycle.Cycle.DataSettings.Count)
return new LSL_List(new object[2] {ScriptBaseClass.WL_ERROR, ScriptBaseClass.WL_ERROR_NO_PRESET_FOUND});
LSL_List list = new LSL_List();
for (int i = 0; i < rules.Data.Length; i++)
{
int rule = rules.GetLSLIntegerItem(i);
ConvertWindlightDayCycle(cycle, dayCycleIndex, rule, ref list);
}
return list;
}
开发者ID:NanaYngvarrdottir,项目名称:WhiteCore-Dev,代码行数:26,代码来源:AA_API.cs
示例3: aaQueryDatabase
public LSL_List aaQueryDatabase(LSL_String key, LSL_String token)
{
if (!ScriptProtection.CheckThreatLevel(ThreatLevel.Moderate, "aaQueryDatabase", m_host, "AA", m_itemID))
return new LSL_List();
List<string> query = AssetConnector.FindLSLData(token.m_string, key.m_string);
LSL_List list = new LSL_List(query.ToArray());
return list;
}
开发者ID:NanaYngvarrdottir,项目名称:WhiteCore-Dev,代码行数:9,代码来源:AA_API.cs
示例4: ConvertLSLToWindlight
private void ConvertLSLToWindlight(ref WindlightDayCycle cycle, int preset, LSL_List list)
{
var skyDatas = cycle.Cycle.DataSettings.Values.ToList();
var skyData = skyDatas[preset];
for (int i = 0; i < list.Data.Length; i += 2)
{
int key = list.GetLSLIntegerItem(i);
switch (key)
{
case ScriptBaseClass.WL_AMBIENT:
{
LSL_Rotation rot = list.GetQuaternionItem(i + 1);
skyData.ambient = rot.ToVector4();
break;
}
case ScriptBaseClass.WL_CLOUD_COLOR:
{
LSL_Rotation rot = list.GetQuaternionItem(i + 1);
skyData.cloud_color = rot.ToVector4();
break;
}
case ScriptBaseClass.WL_CLOUD_POS_DENSITY1:
{
LSL_Rotation rot = list.GetQuaternionItem(i + 1);
skyData.cloud_pos_density1 = rot.ToVector4();
break;
}
case ScriptBaseClass.WL_CLOUD_POS_DENSITY2:
{
LSL_Rotation rot = list.GetQuaternionItem(i + 1);
skyData.cloud_pos_density2 = rot.ToVector4();
break;
}
case ScriptBaseClass.WL_CLOUD_SCALE:
{
LSL_Rotation rot = list.GetQuaternionItem(i + 1);
skyData.cloud_scale = rot.ToVector4();
break;
}
case ScriptBaseClass.WL_CLOUD_SCROLL_X:
{
LSL_Integer integer = list.GetLSLIntegerItem(i + 1);
skyData.cloud_scroll_rate.X = integer;
break;
}
case ScriptBaseClass.WL_CLOUD_SCROLL_Y:
{
LSL_Integer integer = list.GetLSLIntegerItem(i + 1);
skyData.cloud_scroll_rate.Y = integer;
break;
}
case ScriptBaseClass.WL_CLOUD_SCROLL_X_LOCK:
{
LSL_Integer integer = list.GetLSLIntegerItem(i + 1);
skyData.enable_cloud_scroll.X = integer;
break;
}
case ScriptBaseClass.WL_CLOUD_SCROLL_Y_LOCK:
{
LSL_Integer integer = list.GetLSLIntegerItem(i + 1);
skyData.enable_cloud_scroll.Y = integer;
break;
}
case ScriptBaseClass.WL_CLOUD_SHADOW:
{
LSL_Rotation rot = list.GetQuaternionItem(i + 1);
skyData.cloud_shadow = rot.ToVector4();
break;
}
case ScriptBaseClass.WL_SKY_BLUE_DENSITY:
{
LSL_Rotation rot = list.GetQuaternionItem(i + 1);
skyData.blue_density = rot.ToVector4();
break;
}
case ScriptBaseClass.WL_SKY_BLUR_HORIZON:
{
LSL_Rotation rot = list.GetQuaternionItem(i + 1);
skyData.blue_horizon = rot.ToVector4();
break;
}
case ScriptBaseClass.WL_SKY_DENSITY_MULTIPLIER:
{
LSL_Rotation rot = list.GetQuaternionItem(i + 1);
skyData.density_multiplier = rot.ToVector4();
break;
}
case ScriptBaseClass.WL_SKY_DISTANCE_MULTIPLIER:
{
LSL_Rotation rot = list.GetQuaternionItem(i + 1);
skyData.distance_multiplier = rot.ToVector4();
break;
}
case ScriptBaseClass.WL_SKY_GAMMA:
{
LSL_Rotation rot = list.GetQuaternionItem(i + 1);
skyData.gamma = rot.ToVector4();
break;
}
//.........这里部分代码省略.........
开发者ID:NanaYngvarrdottir,项目名称:WhiteCore-Dev,代码行数:101,代码来源:AA_API.cs
示例5: ConvertWindlightDayCycle
private void ConvertWindlightDayCycle(WindlightDayCycle cycle, int preset, int rule, ref LSL_List list)
{
var skyDatas = cycle.Cycle.DataSettings.Values.ToList();
var skyData = skyDatas[preset];
switch (rule)
{
case (int) ScriptBaseClass.WL_AMBIENT:
list.Add(new LSL_Rotation(skyData.ambient.X, skyData.ambient.Y,
skyData.ambient.Z, skyData.ambient.W));
break;
case (int) ScriptBaseClass.WL_SKY_BLUE_DENSITY:
list.Add(new LSL_Rotation(skyData.blue_density.X, skyData.blue_density.Y,
skyData.blue_density.Z, skyData.blue_density.W));
break;
case (int) ScriptBaseClass.WL_SKY_BLUR_HORIZON:
list.Add(new LSL_Rotation(skyData.blue_horizon.X, skyData.blue_horizon.Y,
skyData.blue_horizon.Z, skyData.blue_horizon.W));
break;
case (int) ScriptBaseClass.WL_CLOUD_COLOR:
list.Add(new LSL_Rotation(skyData.cloud_color.X, skyData.cloud_color.Y,
skyData.cloud_color.Z, skyData.cloud_color.W));
break;
case (int) ScriptBaseClass.WL_CLOUD_POS_DENSITY1:
list.Add(new LSL_Rotation(skyData.cloud_pos_density1.X, skyData.cloud_pos_density1.Y,
skyData.cloud_pos_density1.Z, skyData.cloud_pos_density1.W));
break;
case (int) ScriptBaseClass.WL_CLOUD_POS_DENSITY2:
list.Add(new LSL_Rotation(skyData.cloud_pos_density2.X, skyData.cloud_pos_density2.Y,
skyData.cloud_pos_density2.Z, skyData.cloud_pos_density2.W));
break;
case (int) ScriptBaseClass.WL_CLOUD_SCALE:
list.Add(new LSL_Rotation(skyData.cloud_scale.X, skyData.cloud_scale.Y,
skyData.cloud_scale.Z, skyData.cloud_scale.W));
break;
case (int) ScriptBaseClass.WL_CLOUD_SCROLL_X:
list.Add(new LSL_Float(skyData.cloud_scroll_rate.X));
break;
case (int) ScriptBaseClass.WL_CLOUD_SCROLL_X_LOCK:
list.Add(new LSL_Integer(skyData.enable_cloud_scroll.X));
break;
case (int) ScriptBaseClass.WL_CLOUD_SCROLL_Y:
list.Add(new LSL_Float(skyData.cloud_scroll_rate.Y));
break;
case (int) ScriptBaseClass.WL_CLOUD_SCROLL_Y_LOCK:
list.Add(new LSL_Integer(skyData.enable_cloud_scroll.Y));
break;
case (int) ScriptBaseClass.WL_CLOUD_SHADOW:
list.Add(new LSL_Rotation(skyData.cloud_shadow.X, skyData.cloud_shadow.Y, skyData.cloud_shadow.Z,
skyData.cloud_shadow.W));
break;
case (int) ScriptBaseClass.WL_SKY_DENSITY_MULTIPLIER:
list.Add(new LSL_Rotation(skyData.density_multiplier.X, skyData.density_multiplier.Y,
skyData.density_multiplier.Z, skyData.density_multiplier.W));
break;
case (int) ScriptBaseClass.WL_SKY_DISTANCE_MULTIPLIER:
list.Add(new LSL_Rotation(skyData.distance_multiplier.X, skyData.distance_multiplier.Y,
skyData.distance_multiplier.Z, skyData.distance_multiplier.W));
break;
case (int) ScriptBaseClass.WL_SKY_GAMMA:
list.Add(new LSL_Rotation(skyData.gamma.X, skyData.gamma.Y, skyData.gamma.Z, skyData.gamma.W));
break;
case (int) ScriptBaseClass.WL_SKY_GLOW:
list.Add(new LSL_Rotation(skyData.glow.X, skyData.glow.Y, skyData.glow.Z, skyData.glow.W));
break;
case (int) ScriptBaseClass.WL_SKY_HAZE_DENSITY:
list.Add(new LSL_Rotation(skyData.haze_density.X, skyData.haze_density.Y, skyData.haze_density.Z,
skyData.haze_density.W));
break;
case (int) ScriptBaseClass.WL_SKY_HAZE_HORIZON:
list.Add(new LSL_Rotation(skyData.haze_horizon.X, skyData.haze_horizon.Y, skyData.haze_horizon.Z,
skyData.haze_horizon.W));
break;
case (int) ScriptBaseClass.WL_SKY_LIGHT_NORMALS:
list.Add(new LSL_Rotation(skyData.lightnorm.X, skyData.lightnorm.Y, skyData.lightnorm.Z,
skyData.lightnorm.W));
break;
case (int) ScriptBaseClass.WL_SKY_MAX_ALTITUDE:
list.Add(new LSL_Rotation(skyData.max_y.X, skyData.max_y.Y, skyData.max_y.Z, skyData.max_y.W));
break;
case (int) ScriptBaseClass.WL_SKY_STAR_BRIGHTNESS:
list.Add(new LSL_Float(skyData.star_brightness));
break;
case (int) ScriptBaseClass.WL_SKY_SUNLIGHT_COLOR:
list.Add(new LSL_Rotation(skyData.sunlight_color.X, skyData.sunlight_color.Y,
skyData.sunlight_color.Z, skyData.sunlight_color.W));
break;
case (int) ScriptBaseClass.WL_WATER_BLUR_MULTIPLIER:
list.Add(new LSL_Float(cycle.Water.blurMultiplier));
break;
case (int) ScriptBaseClass.WL_WATER_FRESNEL_OFFSET:
list.Add(new LSL_Float(cycle.Water.fresnelOffset));
break;
case (int) ScriptBaseClass.WL_WATER_FRESNEL_SCALE:
list.Add(new LSL_Float(cycle.Water.fresnelScale));
break;
case (int) ScriptBaseClass.WL_WATER_NORMAL_MAP:
list.Add(new LSL_String(cycle.Water.normalMap));
break;
//.........这里部分代码省略.........
开发者ID:NanaYngvarrdottir,项目名称:WhiteCore-Dev,代码行数:101,代码来源:AA_API.cs
示例6: aaWindlightGetDayCycle
public LSL_List aaWindlightGetDayCycle()
{
IEnvironmentSettingsModule environmentSettings = World.RequestModuleInterface<IEnvironmentSettingsModule>();
if (environmentSettings == null)
return new LSL_List(new object[2] {ScriptBaseClass.WL_ERROR, ScriptBaseClass.WL_ERROR_NO_SCENE_SET});
WindlightDayCycle cycle = environmentSettings.GetCurrentDayCycle();
if (cycle == null)
return new LSL_List(new object[2] {ScriptBaseClass.WL_ERROR, ScriptBaseClass.WL_ERROR_NO_SCENE_SET});
if (cycle.Cycle.IsStaticDayCycle)
return new LSL_List(new object[3] {0, -1, cycle.Cycle.DataSettings["-1"].preset_name});
LSL_List list = new LSL_List();
int i = 0;
foreach (var key in cycle.Cycle.DataSettings)
{
list.Add(i++);
list.Add(key.Key);
list.Add(key.Value.preset_name);
}
return list;
}
开发者ID:NanaYngvarrdottir,项目名称:WhiteCore-Dev,代码行数:23,代码来源:AA_API.cs
示例7: aaWindlightSetScene
public LSL_Integer aaWindlightSetScene(int dayCycleIndex, LSL_List list)
{
IEnvironmentSettingsModule environmentSettings = World.RequestModuleInterface<IEnvironmentSettingsModule>();
if (environmentSettings == null)
return ScriptBaseClass.WL_ERROR_NO_SCENE_SET;
WindlightDayCycle cycle = environmentSettings.GetCurrentDayCycle();
if (cycle == null)
return ScriptBaseClass.WL_ERROR_NO_SCENE_SET;
if (!cycle.Cycle.IsStaticDayCycle)
return ScriptBaseClass.WL_ERROR_SCENE_MUST_BE_STATIC;
if (dayCycleIndex >= cycle.Cycle.DataSettings.Count)
return ScriptBaseClass.WL_ERROR_BAD_SETTING;
ConvertLSLToWindlight(ref cycle, dayCycleIndex, list);
environmentSettings.SetDayCycle(cycle);
environmentSettings.TriggerWindlightUpdate(1);
return ScriptBaseClass.WL_OK;
}
开发者ID:NanaYngvarrdottir,项目名称:WhiteCore-Dev,代码行数:19,代码来源:AA_API.cs
示例8: llListFindList
/// <summary>
/// Returns the index of the first occurrence of test
/// in src.
/// </summary>
public LSL_Integer llListFindList(LSL_List src, LSL_List test)
{
int index = -1;
int length = src.Length - test.Length + 1;
if (!ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL", m_itemID))
return 0;
// If either list is empty, do not match
if (src.Length != 0 && test.Length != 0)
{
for (int i = 0; i < length; i++)
{
if (src.Data[i].Equals(test.Data[0]) || test.Data[0].Equals(src.Data[i]))
{
int j;
for (j = 1; j < test.Length; j++)
if (!(src.Data[i + j].Equals(test.Data[j]) || test.Data[j].Equals(src.Data[i + j])))
break;
if (j == test.Length)
{
index = i;
break;
}
}
}
}
return index;
}
开发者ID:WhiteCoreSim,项目名称:WhiteCore-Dev,代码行数:35,代码来源:LSL_Api.cs
示例9: botGetBotsWithTag
public LSL_List botGetBotsWithTag(string tag)
{
if (!ScriptProtection.CheckThreatLevel(ThreatLevel.Moderate, "botGetBotsWithTag", m_host, "bot", m_itemID))
return new LSL_List();
IBotManager manager = World.RequestModuleInterface<IBotManager>();
List<UUID> bots = new List<UUID>();
if (manager != null)
bots = manager.GetBotsWithTag(tag);
LSL_List b = new LSL_List();
foreach (UUID bot in bots)
b.Add(bot.ToString());
return b;
}
开发者ID:QueenStarfinder,项目名称:WhiteCore-Dev,代码行数:14,代码来源:Bot_API.cs
示例10: aaSetEnv
public void aaSetEnv(LSL_String name, LSL_List value)
{
if (!ScriptProtection.CheckThreatLevel(ThreatLevel.VeryHigh, "aaSetEnv", m_host, "AA", m_itemID))
return;
if (!World.Permissions.IsGod(m_host.OwnerID))
{
LSLError("You do not have god permissions.");
return;
}
if (name == ScriptBaseClass.ENABLE_GRAVITY)
{
LSL_Integer enabled = value.GetLSLIntegerItem(0);
float[] grav = m_host.ParentEntity.Scene.PhysicsScene.GetGravityForce();
m_host.ParentEntity.Scene.PhysicsScene.SetGravityForce(enabled == 1, grav[0], grav[1], grav[2]);
}
else if (name == ScriptBaseClass.GRAVITY_FORCE_X)
{
LSL_Float f = value.GetLSLFloatItem(0);
float[] grav = m_host.ParentEntity.Scene.PhysicsScene.GetGravityForce();
m_host.ParentEntity.Scene.PhysicsScene.SetGravityForce(true, (float) f.value, grav[1], grav[2]);
}
else if (name == ScriptBaseClass.GRAVITY_FORCE_Y)
{
LSL_Float f = value.GetLSLFloatItem(0);
float[] grav = m_host.ParentEntity.Scene.PhysicsScene.GetGravityForce();
m_host.ParentEntity.Scene.PhysicsScene.SetGravityForce(true, grav[0], (float) f.value, grav[2]);
}
else if (name == ScriptBaseClass.GRAVITY_FORCE_Z)
{
LSL_Float f = value.GetLSLFloatItem(0);
float[] grav = m_host.ParentEntity.Scene.PhysicsScene.GetGravityForce();
m_host.ParentEntity.Scene.PhysicsScene.SetGravityForce(true, grav[0], grav[1], (float) f.value);
}
else if (name == ScriptBaseClass.ADD_GRAVITY_POINT)
{
LSL_Vector pos = value.GetVector3Item(0);
LSL_Float gravForce = value.GetLSLFloatItem(1);
LSL_Float radius = value.GetLSLFloatItem(2);
LSL_Integer ident = value.GetLSLIntegerItem(3);
m_host.ParentEntity.Scene.PhysicsScene.AddGravityPoint(false,
new Vector3((float) pos.x, (float) pos.y,
(float) pos.z),
0, 0, 0, (float) gravForce.value,
(float) radius.value, ident.value);
}
else if (name == ScriptBaseClass.ADD_GRAVITY_FORCE)
{
LSL_Vector pos = value.GetVector3Item(0);
LSL_Float xForce = value.GetLSLFloatItem(1);
LSL_Float yForce = value.GetLSLFloatItem(2);
LSL_Float zForce = value.GetLSLFloatItem(3);
LSL_Float radius = value.GetLSLFloatItem(4);
LSL_Integer ident = value.GetLSLIntegerItem(5);
m_host.ParentEntity.Scene.PhysicsScene.AddGravityPoint(true,
new Vector3((float) pos.x, (float) pos.y,
(float) pos.z),
(float) xForce, (float) yForce, (float) zForce, 0,
(float) radius.value, ident.value);
}
else if (name == ScriptBaseClass.START_TIME_REVERSAL_SAVING)
{
IPhysicsStateModule physicsState = World.RequestModuleInterface<IPhysicsStateModule>();
if (physicsState != null)
physicsState.StartSavingPhysicsTimeReversalStates();
}
else if (name == ScriptBaseClass.STOP_TIME_REVERSAL_SAVING)
{
IPhysicsStateModule physicsState = World.RequestModuleInterface<IPhysicsStateModule>();
if (physicsState != null)
physicsState.StopSavingPhysicsTimeReversalStates();
}
else if (name == ScriptBaseClass.START_TIME_REVERSAL)
{
IPhysicsStateModule physicsState = World.RequestModuleInterface<IPhysicsStateModule>();
if (physicsState != null)
physicsState.StartPhysicsTimeReversal();
}
else if (name == ScriptBaseClass.STOP_TIME_REVERSAL)
{
IPhysicsStateModule physicsState = World.RequestModuleInterface<IPhysicsStateModule>();
if (physicsState != null)
physicsState.StopPhysicsTimeReversal();
}
}
开发者ID:NanaYngvarrdottir,项目名称:WhiteCore-Dev,代码行数:84,代码来源:AA_API.cs
示例11: aaDeserializeXMLValues
public LSL_List aaDeserializeXMLValues(LSL_String xmlFile)
{
if (!ScriptProtection.CheckThreatLevel(ThreatLevel.Moderate, "aaDeserializeXMLValues", m_host, "AA",
m_itemID)) return new LSL_List();
XmlDocument doc = new XmlDocument();
doc.LoadXml(xmlFile.m_string);
XmlNodeList children = doc.ChildNodes;
LSL_List values = new LSL_List();
foreach (XmlNode node in children)
{
values.Add(node.InnerText);
}
return values;
}
开发者ID:NanaYngvarrdottir,项目名称:WhiteCore-Dev,代码行数:14,代码来源:AA_API.cs
示例12:
public LSL_String llDumpList2String(LSL_List src, string seperator)
{
if (!ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL", m_itemID))
return "";
if (src.Length == 0)
{
return string.Empty;
}
string ret = src.Data.Aggregate("", (current, o) => current + (o + seperator));
ret = ret.Substring(0, ret.Length - seperator.Length);
return ret;
}
开发者ID:WhiteCoreSim,项目名称:WhiteCore-Dev,代码行数:15,代码来源:LSL_Api.cs
示例13: llDialog
public DateTime llDialog(string avatar, string message, LSL_List buttons, int chat_channel)
{
IDialogModule dm = World.RequestModuleInterface<IDialogModule>();
if (dm == null)
return DateTime.Now;
if (!ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL", m_itemID))
return DateTime.Now;
UUID av = new UUID();
if (!UUID.TryParse(avatar, out av))
{
//Silently accepted in in SL NOTE: it does sleep though!
//LSLError("First parameter to llDialog needs to be a key");
return PScriptSleep(m_sleepMsOnDialog);
}
if (buttons.Length > 12)
{
Error("llDialog", "No more than 12 buttons can be shown");
return DateTime.Now;
}
string[] buts = new string[buttons.Length];
for (int i = 0; i < buttons.Length; i++)
{
if (buttons.Data[i].ToString() == string.Empty)
{
Error("llDialog", "Button label cannot be blank");
return DateTime.Now;
}
if (buttons.Data[i].ToString().Length > 24)
{
Error("llDialog", "Button label cannot be longer than 24 characters");
return DateTime.Now;
}
buts[i] = buttons.Data[i].ToString();
}
if (buts.Length == 0)
buts = new[] { "OK" };
dm.SendDialogToUser(
av, m_host.Name, m_host.UUID, m_host.OwnerID,
message, new UUID("00000000-0000-2222-3333-100000001000"), chat_channel, buts);
return PScriptSleep(m_sleepMsOnDialog);
}
开发者ID:WhiteCoreSim,项目名称:WhiteCore-Dev,代码行数:46,代码来源:LSL_Api.cs
示例14: SetParticleSystem
private void SetParticleSystem(ISceneChildEntity part, LSL_List rules)
{
if (rules.Length == 0)
{
part.RemoveParticleSystem();
}
else
{
Primitive.ParticleSystem prules = getNewParticleSystemWithSLDefaultValues();
LSL_Vector tempv = new LSL_Vector();
float tempf = 0;
int tmpi = 0;
for (int i = 0; i < rules.Length; i += 2)
{
LSL_Integer rule = rules.GetLSLIntegerItem(i);
if (rule == (int)ScriptBaseClass.PSYS_PART_FLAGS)
{
prules.PartDataFlags =
(Primitive.ParticleSystem.ParticleDataFlags)(uint)rules.GetLSLIntegerItem(i + 1);
}
else if (rule == (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;
}
else if (rule == (int)ScriptBaseClass.PSYS_PART_START_ALPHA)
{
tempf = (float)rules.GetLSLFloatItem(i + 1);
prules.PartStartColor.A = tempf;
}
else if (rule == (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;
}
else if (rule == (int)ScriptBaseClass.PSYS_PART_END_ALPHA)
{
tempf = (float)rules.GetLSLFloatItem(i + 1);
prules.PartEndColor.A = tempf;
}
else if (rule == (int)ScriptBaseClass.PSYS_PART_START_SCALE)
{
tempv = rules.GetVector3Item(i + 1);
prules.PartStartScaleX = (float)tempv.x;
prules.PartStartScaleY = (float)tempv.y;
}
else if (rule == (int)ScriptBaseClass.PSYS_PART_END_SCALE)
{
tempv = rules.GetVector3Item(i + 1);
prules.PartEndScaleX = (float)tempv.x;
prules.PartEndScaleY = (float)tempv.y;
}
else if (rule == (int)ScriptBaseClass.PSYS_PART_MAX_AGE)
{
tempf = (float)rules.GetLSLFloatItem(i + 1);
prules.PartMaxAge = tempf;
}
else if (rule == (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;
}
else if (rule == (int)ScriptBaseClass.PSYS_SRC_PATTERN)
{
tmpi = rules.GetLSLIntegerItem(i + 1);
prules.Pattern = (Primitive.ParticleSystem.SourcePattern)tmpi;
}
// 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.
else if (rule == (int)ScriptBaseClass.PSYS_SRC_INNERANGLE)
{
tempf = (float)rules.GetLSLFloatItem(i + 1);
prules.InnerAngle = tempf;
prules.PartFlags &= 0xFFFFFFFD; // Make sure new angle format is off.
}
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.
//.........这里部分代码省略.........
开发者ID:WhiteCoreSim,项目名称:WhiteCore-Dev,代码行数:101,代码来源:LSL_Api.cs
示例15: llGiveInventoryList
public void llGiveInventoryList(string destination, string category, LSL_List inventory)
{
if (!ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL", m_itemID))
return;
UUID destID;
if (!UUID.TryParse(destination, out destID))
return;
List<UUID> itemList = new List<UUID>();
foreach (object item in inventory.Data)
{
UUID itemID;
if (UUID.TryParse(item.ToString(), out itemID))
{
itemList.Add(itemID);
}
else
{
itemID = GetTaskInventoryItem(item.ToString());
if (itemID != UUID.Zero)
itemList.Add(itemID);
}
}
if (itemList.Count == 0)
return;
UUID folderID = UUID.Zero;
ILLClientInventory inventoryModule = World.RequestModuleInterface<ILLClientInventory>();
if (inventoryModule != null)
folderID = inventoryModule.MoveTaskInventoryItemsToUserInventory(destID, category, m_host, itemList);
if (folderID == UUID.Zero)
return;
byte[] bucket = new byte[17];
bucket[0] = (byte)AssetType.Folder;
byte[] objBytes = folderID.GetBytes();
Array.Copy(objBytes, 0, bucket, 1, 16);
GridInstantMessage msg = new GridInstantMessage()
{
FromAgentID = m_host.UUID,
FromAgentName = m_host.Name + ", an object owned by " +
resolveName(m_host.OwnerID) + ",",
ToAgentID = destID,
Dialog = (byte)InstantMessageDialog.InventoryOffered,
Message = category + "\n" + m_host.Name + " is located at " +
World.RegionInfo.RegionName + " " +
m_host.AbsolutePosition,
SessionID = folderID,
Offline = 1,
Position = m_host.AbsolutePosition,
BinaryBucket = bucket,
RegionID = m_host.ParentEntity.Scene.RegionInfo.RegionID
};
if (m_TransferModule != null)
m_TransferModule.SendInstantMessage(msg);
}
开发者ID:WhiteCoreSim,项目名称:WhiteCore-Dev,代码行数:62,代码来源:LSL_Api.cs
示例16: llParticleSystem
public void llParticleSystem(LSL_List rules)
{
if (!ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL", m_itemID))
return;
SetParticleSystem(m_host, rules);
}
开发者ID:WhiteCoreSim,项目名称:WhiteCore-Dev,代码行数:7,代码来源:LSL_Api.cs
示例17: llLinkParticleSystem
public void llLinkParticleSystem(int linknumber, LSL_List rules)
{
if (!ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL", m_itemID))
return;
List<ISceneChildEntity> parts = GetLinkParts(linknumber);
foreach (var part in parts)
{
SetParticleSystem(part, rules);
}
}
开发者ID:WhiteCoreSim,项目名称:WhiteCore-Dev,代码行数:13,代码来源:LSL_Api.cs
示例18: llGetAttachedList
public LSL_List llGetAttachedList(string id)
{
if (!ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL", m_itemID))
return new LSL_List();
IScenePresence av = World.GetScenePresence((UUID)id);
if (av == null || av.IsDeleted)
return new LSL_List("NOT FOUND");
if (av.IsChildAgent || av.IsInTransit)
return new LSL_List("NOT ON REGION");
LSL_List AttachmentsList = new LSL_List();
IAttachmentsModule attachMod = World.RequestModuleInterface<IAttachmentsModule>();
if (attachMod != null)
{
ISceneEntity[] Attachments = attachMod.GetAttachmentsForAvatar(av.UUID);
foreach (ISceneEntity Attachment in Attachments)
{
AttachmentsList.Add(new LSL_Key(Attachment.UUID.ToString()));
}
}
return AttachmentsList;
}
开发者ID:WhiteCoreSim,项目名称:WhiteCore-Dev,代码行数:25,代码来源:LSL_Api.cs
示例19: llGetLinkPrimitiveParams
public LSL_List llGetLinkPrimitiveParams(int linknumber, LSL_List rules)
{
if (!ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL", m_itemID))
return new LSL_List();
List<ISceneChildEntity> parts = GetLinkParts(linknumber);
LSL_List res = new LSL_List();
return parts.Select(part => GetLinkPrimitiveParams(part, rules, m_allowOpenSimParams))
.Aggregate(res, (current, partRes) => current + partRes);
}
开发者ID:WhiteCoreSim,项目名称:WhiteCore-Dev,代码行数:13,代 |
请发表评论