本文整理汇总了C#中WhiteCore.ScriptEngine.DotNetEngine.LSL_Types.LSLString类的典型用法代码示例。如果您正苦于以下问题:C# WhiteCore.ScriptEngine.DotNetEngine.LSL_Types.LSLString类的具体用法?C# WhiteCore.ScriptEngine.DotNetEngine.LSL_Types.LSLString怎么用?C# WhiteCore.ScriptEngine.DotNetEngine.LSL_Types.LSLString使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WhiteCore.ScriptEngine.DotNetEngine.LSL_Types.LSLString类属于命名空间,在下文中一共展示了WhiteCore.ScriptEngine.DotNetEngine.LSL_Types.LSLString类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: llJsonSetValue
public LSL_String llJsonSetValue(LSL_String json, LSL_List specifiers, LSL_String value)
{
try
{
OSD o = OSDParser.DeserializeJson(json);
JsonSetSpecific(o, specifiers, 0, value);
return OSDParser.SerializeJsonString(o);
}
catch (Exception)
{
}
return ScriptBaseClass.JSON_INVALID;
}
示例2: 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();
}
}
示例3: botSetRot
public void botSetRot(LSL_Key npc, LSL_Rotation rotation)
{
if (!ScriptProtection.CheckThreatLevel(ThreatLevel.Moderate, "botStandUp", m_host, "bot", m_itemID)) return;
IScenePresence sp = World.GetScenePresence(UUID.Parse(npc));
if (sp == null)
return;
UUID npcId;
if (!UUID.TryParse(npc.m_string, out npcId))
return;
if (sp != null)
sp.Rotation = rotation.ToQuaternion();
}
示例4: aaGetTeamMembers
public LSL_List aaGetTeamMembers(LSL_String team)
{
if (!ScriptProtection.CheckThreatLevel(ThreatLevel.Low, "aaGetTeamMembers", m_host, "AA", m_itemID))
return new LSL_List();
List<UUID> Members = new List<UUID>();
ICombatModule module = World.RequestModuleInterface<ICombatModule>();
if (module != null)
{
Members = module.GetTeammates(team);
}
LSL_List members = new LSL_List();
foreach (UUID member in Members)
members.Add(new LSL_Key(member.ToString()));
return members;
}
示例5: aaLeaveCombat
public void aaLeaveCombat(LSL_Key uuid)
{
if (!ScriptProtection.CheckThreatLevel(ThreatLevel.Low, "aaLeaveCombat", m_host, "AA", m_itemID)) return;
UUID avID;
if (UUID.TryParse(uuid, out avID))
{
IScenePresence SP = World.GetScenePresence(avID);
if (SP != null)
{
ICombatPresence CP = SP.RequestModuleInterface<ICombatPresence>();
if (CP != null)
{
CP.LeaveCombat();
}
}
}
}
示例6: 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;
}
示例7: aaGetLastOwner
public LSL_String aaGetLastOwner(LSL_String PrimID)
{
if (!ScriptProtection.CheckThreatLevel(ThreatLevel.None, "aaGetLastOwner", m_host, "AA", m_itemID))
return new LSL_String();
ISceneChildEntity part = m_host.ParentEntity.Scene.GetSceneObjectPart(UUID.Parse(PrimID.m_string));
if (part != null)
return new LSL_String(part.LastOwnerID.ToString());
else
return ScriptBaseClass.NULL_KEY;
}
示例8: llAgentInExperience
public LSL_Integer llAgentInExperience(LSL_Key agent)
{
NotImplemented("llAgentInExperience", "Not implemented at this moment");
return 0;
}
示例9: llClearExperiencePermissions
public void llClearExperiencePermissions(LSL_Key agent)
{
NotImplemented("llClearExperiencePermissions", "Not implemented at this moment");
}
示例10: llReturnObjectsByOwner
public LSL_Integer llReturnObjectsByOwner(LSL_Key owner, LSL_Integer scope)
{
NotImplemented("llReturnObjectsByOwner", "Not implemented at this moment");
return 0;
}
示例11: NotImplemented
public LSL_String llXorBase64(LSL_String str1, LSL_String str2)
{
NotImplemented("llXorBase64", "Not implemented at this moment");
return string.Empty;
}
示例12: llJsonValueType
public LSL_String llJsonValueType(LSL_String json, LSL_List specifiers)
{
OSD o = OSDParser.DeserializeJson(json);
OSD specVal = JsonGetSpecific(o, specifiers, 0);
if (specVal == null)
return ScriptBaseClass.JSON_INVALID;
switch (specVal.Type)
{
case OSDType.Array:
return ScriptBaseClass.JSON_ARRAY;
case OSDType.Boolean:
return specVal.AsBoolean() ? ScriptBaseClass.JSON_TRUE : ScriptBaseClass.JSON_FALSE;
case OSDType.Integer:
case OSDType.Real:
return ScriptBaseClass.JSON_NUMBER;
case OSDType.Map:
return ScriptBaseClass.JSON_OBJECT;
case OSDType.String:
case OSDType.UUID:
return ScriptBaseClass.JSON_STRING;
case OSDType.Unknown:
return ScriptBaseClass.JSON_NULL;
}
return ScriptBaseClass.JSON_INVALID;
}
示例13: JsonBuildRestOfSpec
private OSD JsonBuildRestOfSpec(LSL_List specifiers, int i, LSL_String val)
{
object spec = i >= specifiers.Data.Length ? null : specifiers.Data[i];
// 20131224 not used object specNext = i+1 >= specifiers.Data.Length ? null : specifiers.Data[i+1];
if (spec == null)
return OSD.FromString(val);
if (spec is LSL_Integer ||
(spec is LSL_String && ((LSL_String)spec) == ScriptBaseClass.JSON_APPEND)) {
OSDArray array = new OSDArray ();
array.Add (JsonBuildRestOfSpec (specifiers, i + 1, val));
return array;
}
if (spec is LSL_String) {
OSDMap map = new OSDMap ();
map.Add ((LSL_String)spec, JsonBuildRestOfSpec (specifiers, i + 1, val));
return map;
}
return new OSD();
}
示例14: JsonSetSpecific
void JsonSetSpecific(OSD o, LSL_List specifiers, int i, LSL_String val)
{
object spec = specifiers.Data[i];
// 20131224 not used object specNext = i+1 == specifiers.Data.Length ? null : specifiers.Data[i+1];
OSD nextVal = null;
if (o is OSDArray)
{
OSDArray array = ((OSDArray)o);
if (spec is LSL_Integer)
{
int v = ((LSL_Integer)spec).value;
if (v >= array.Count)
array.Add(JsonBuildRestOfSpec(specifiers, i + 1, val));
else
nextVal = ((OSDArray)o)[v];
}
else if (spec is LSL_String && ((LSL_String)spec) == ScriptBaseClass.JSON_APPEND)
array.Add(JsonBuildRestOfSpec(specifiers, i + 1, val));
}
if (o is OSDMap)
{
if (spec is LSL_String)
{
OSDMap map = ((OSDMap)o);
if (map.ContainsKey(((LSL_String)spec).m_string))
nextVal = map[((LSL_String)spec).m_string];
else
map.Add(((LSL_String)spec).m_string, JsonBuildRestOfSpec(specifiers, i + 1, val));
}
}
if (nextVal != null)
{
if (specifiers.Data.Length - 1 > i)
{
JsonSetSpecific(nextVal, specifiers, i + 1, val);
return;
}
}
}
示例15: llTeleportAgentHome
public DateTime llTeleportAgentHome(LSL_Key _agent)
{
if (!ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL", m_itemID))
return DateTime.Now;
string agent = _agent.ToString();
UUID agentId = new UUID();
if (UUID.TryParse(agent, out agentId))
{
IScenePresence presence = World.GetScenePresence(agentId);
if (presence != null)
{
// agent must be over the owners land
IParcelManagementModule parcelManagement = World.RequestModuleInterface<IParcelManagementModule>();
if (parcelManagement != null)
{
if (m_host.OwnerID != parcelManagement.GetLandObject(
presence.AbsolutePosition.X, presence.AbsolutePosition.Y).LandData.OwnerID &&
!World.Permissions.CanIssueEstateCommand(m_host.OwnerID, false))
{
return PScriptSleep(m_sleepMsOnTeleportAgentHome);
}
}
//Send disable cancel so that the agent cannot attempt to stay in the region
presence.ControllingClient.SendTeleportStart((uint)TeleportFlags.DisableCancel);
IEntityTransferModule transferModule = World.RequestModuleInterface<IEntityTransferModule>();
if (transferModule != null)
transferModule.TeleportHome(agentId, presence.ControllingClient);
else
presence.ControllingClient.SendTeleportFailed("Unable to perform teleports on this simulator.");
}
}
return PScriptSleep(m_sleepMsOnTeleportAgentHome);
}