本文整理汇总了C#中OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString类的典型用法代码示例。如果您正苦于以下问题:C# OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString类的具体用法?C# OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString怎么用?C# OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString类属于命名空间,在下文中一共展示了OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: osNpcLoadAppearance
public void osNpcLoadAppearance(LSL_Key npc, string notecard)
{
CheckThreatLevel(ThreatLevel.High, "osNpcLoadAppearance");
m_host.AddScriptLPS(1);
INPCModule npcModule = World.RequestModuleInterface<INPCModule>();
if (npcModule != null)
{
UUID npcId;
if (!UUID.TryParse(npc.m_string, out npcId))
return;
if (!npcModule.CheckPermissions(npcId, m_host.OwnerID))
return;
string appearanceSerialized = LoadNotecard(notecard);
if (appearanceSerialized == null)
OSSLError(string.Format("osNpcCreate: Notecard reference '{0}' not found.", notecard));
OSDMap appearanceOsd = (OSDMap)OSDParser.DeserializeLLSDXml(appearanceSerialized);
// OSD a = OSDParser.DeserializeLLSDXml(appearanceSerialized);
// Console.WriteLine("appearanceSerialized {0}", appearanceSerialized);
// Console.WriteLine("a.Type {0}, a.ToString() {1}", a.Type, a);
AvatarAppearance appearance = new AvatarAppearance();
appearance.Unpack(appearanceOsd);
npcModule.SetNPCAppearance(npcId, appearance, m_host.ParentGroup.Scene);
}
}
开发者ID:nebadon2025,项目名称:opensimulator,代码行数:31,代码来源:OSSL_Api.cs
示例2: 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;
}
开发者ID:nebadon2025,项目名称:opensimulator,代码行数:35,代码来源:OSSL_Api.cs
示例3: osSetContentType
/// <summary>
/// Sets the response type for an HTTP request/response
/// </summary>
/// <returns></returns>
public void osSetContentType(LSL_Key id, string type)
{
CheckThreatLevel(ThreatLevel.High, "osSetContentType");
if (m_UrlModule != null)
m_UrlModule.HttpContentType(new UUID(id),type);
}
开发者ID:nebadon2025,项目名称:opensimulator,代码行数:11,代码来源:OSSL_Api.cs
示例4: osSetProjectionParams
/// <summary>
/// Set parameters for light projection with uuid of target prim
/// </summary>
public void osSetProjectionParams(LSL_Key prim, bool projection, LSL_Key texture, double fov, double focus, double amb)
{
CheckThreatLevel(ThreatLevel.High, "osSetProjectionParams");
m_host.AddScriptLPS(1);
SceneObjectPart obj = null;
if (prim == UUID.Zero.ToString())
{
obj = m_host;
}
else
{
obj = World.GetSceneObjectPart(new UUID(prim));
if (obj == null)
return;
}
obj.Shape.ProjectionEntry = projection;
obj.Shape.ProjectionTextureUUID = new UUID(texture);
obj.Shape.ProjectionFOV = (float)fov;
obj.Shape.ProjectionFocus = (float)focus;
obj.Shape.ProjectionAmbiance = (float)amb;
obj.ParentGroup.HasGroupChanged = true;
obj.ScheduleFullUpdate();
}
开发者ID:nebadon2025,项目名称:opensimulator,代码行数:29,代码来源:OSSL_Api.cs
示例5: osEjectFromGroup
/// <summary>
/// Eject user from the group this object is set to
/// </summary>
/// <param name="agentId"></param>
/// <returns></returns>
public LSL_Integer osEjectFromGroup(LSL_Key agentId)
{
CheckThreatLevel(ThreatLevel.VeryLow, "osEjectFromGroup");
m_host.AddScriptLPS(1);
UUID agent = new UUID(agentId);
// groups module is required
IGroupsModule groupsModule = m_ScriptEngine.World.RequestModuleInterface<IGroupsModule>();
if (groupsModule == null) return ScriptBaseClass.FALSE;
// object has to be set to a group, but not group owned
if (m_host.GroupID == UUID.Zero || m_host.GroupID == m_host.OwnerID) return ScriptBaseClass.FALSE;
// object owner has to be in that group and required permissions
GroupMembershipData member = groupsModule.GetMembershipData(m_host.GroupID, m_host.OwnerID);
if (member == null || (member.GroupPowers & (ulong)GroupPowers.Eject) == 0) return ScriptBaseClass.FALSE;
// agent has to be in that group
//member = groupsModule.GetMembershipData(agent, m_host.GroupID, agent);
//if (member == null) return ScriptBaseClass.FALSE;
// ejectee can be offline
groupsModule.EjectGroupMember(null, m_host.OwnerID, m_host.GroupID, agent);
return ScriptBaseClass.TRUE;
}
开发者ID:nebadon2025,项目名称:opensimulator,代码行数:33,代码来源:OSSL_Api.cs
示例6: osGetGender
/// <summary>
/// Get the gender as specified in avatar appearance for a given avatar key
/// </summary>
/// <param name="rawAvatarId"></param>
/// <returns>"male" or "female" or "unknown"</returns>
public LSL_String osGetGender(LSL_Key rawAvatarId)
{
CheckThreatLevel(ThreatLevel.None, "osGetGender");
m_host.AddScriptLPS(1);
UUID avatarId;
if (!UUID.TryParse(rawAvatarId, out avatarId))
return new LSL_String("unknown");
ScenePresence sp = World.GetScenePresence(avatarId);
if (sp == null || sp.IsChildAgent || sp.Appearance == null || sp.Appearance.VisualParams == null)
return new LSL_String("unknown");
// find the index of "shape" parameter "male"
int vpShapeMaleIndex = 0;
bool indexFound = false;
VisualParam param = new VisualParam();
foreach(var vpEntry in VisualParams.Params)
{
param = vpEntry.Value;
if (param.Name == "male" && param.Wearable == "shape")
{
indexFound = true;
break;
}
if (param.Group == 0)
vpShapeMaleIndex++;
}
if (!indexFound)
return new LSL_String("unknown");
float vpShapeMale = Utils.ByteToFloat(sp.Appearance.VisualParams[vpShapeMaleIndex], param.MinValue, param.MaxValue);
bool isMale = vpShapeMale > 0.5f;
return new LSL_String(isMale ? "male" : "female");
}
开发者ID:nebadon2025,项目名称:opensimulator,代码行数:44,代码来源:OSSL_Api.cs
示例7: osSetPrimitiveParams
public void osSetPrimitiveParams(LSL_Key prim, LSL_List rules)
{
CheckThreatLevel(ThreatLevel.High, "osSetPrimitiveParams");
m_host.AddScriptLPS(1);
InitLSL();
m_LSL_Api.SetPrimitiveParamsEx(prim, rules, "osSetPrimitiveParams");
}
开发者ID:nebadon2025,项目名称:opensimulator,代码行数:8,代码来源:OSSL_Api.cs
示例8: osNpcSetRot
public void osNpcSetRot(LSL_Key npc, LSL_Rotation rotation)
{
CheckThreatLevel(ThreatLevel.High, "osNpcSetRot");
m_host.AddScriptLPS(1);
INPCModule npcModule = World.RequestModuleInterface<INPCModule>();
if (npcModule != null)
{
UUID npcId;
if (!UUID.TryParse(npc.m_string, out npcId))
return;
if (!npcModule.CheckPermissions(npcId, m_host.OwnerID))
return;
ScenePresence sp = World.GetScenePresence(npcId);
if (sp != null)
sp.Rotation = rotation;
}
}
开发者ID:nebadon2025,项目名称:opensimulator,代码行数:21,代码来源:OSSL_Api.cs
示例9: osNpcSetProfileAbout
public void osNpcSetProfileAbout(LSL_Key npc, string about)
{
CheckThreatLevel(ThreatLevel.Low, "osNpcSetProfileAbout");
m_host.AddScriptLPS(1);
INPCModule module = World.RequestModuleInterface<INPCModule>();
if (module != null)
{
UUID npcId = new UUID(npc.m_string);
if (!module.CheckPermissions(npcId, m_host.OwnerID))
return;
ScenePresence sp = World.GetScenePresence(npcId);
if (sp != null)
((INPC)(sp.ControllingClient)).profileAbout = about;
}
}
开发者ID:nebadon2025,项目名称:opensimulator,代码行数:18,代码来源:OSSL_Api.cs
示例10: osNpcMoveToTarget
public void osNpcMoveToTarget(LSL_Key npc, LSL_Vector target, int options)
{
CheckThreatLevel(ThreatLevel.High, "osNpcMoveToTarget");
m_host.AddScriptLPS(1);
INPCModule module = World.RequestModuleInterface<INPCModule>();
if (module != null)
{
UUID npcId;
if (!UUID.TryParse(npc.m_string, out npcId))
return;
if (!module.CheckPermissions(npcId, m_host.OwnerID))
return;
module.MoveToTarget(
new UUID(npc.m_string),
World,
target,
(options & ScriptBaseClass.OS_NPC_NO_FLY) != 0,
(options & ScriptBaseClass.OS_NPC_LAND_AT_TARGET) != 0,
(options & ScriptBaseClass.OS_NPC_RUNNING) != 0);
}
}
开发者ID:nebadon2025,项目名称:opensimulator,代码行数:24,代码来源:OSSL_Api.cs
示例11: osNpcGetRot
public LSL_Rotation osNpcGetRot(LSL_Key npc)
{
CheckThreatLevel(ThreatLevel.High, "osNpcGetRot");
m_host.AddScriptLPS(1);
INPCModule npcModule = World.RequestModuleInterface<INPCModule>();
if (npcModule != null)
{
UUID npcId;
if (!UUID.TryParse(npc.m_string, out npcId))
return new LSL_Rotation(Quaternion.Identity);
if (!npcModule.CheckPermissions(npcId, m_host.OwnerID))
return new LSL_Rotation(Quaternion.Identity);
ScenePresence sp = World.GetScenePresence(npcId);
if (sp != null)
return new LSL_Rotation(sp.GetWorldRotation());
}
return Quaternion.Identity;
}
开发者ID:nebadon2025,项目名称:opensimulator,代码行数:23,代码来源:OSSL_Api.cs
示例12: osNpcMoveTo
public void osNpcMoveTo(LSL_Key npc, LSL_Vector pos)
{
CheckThreatLevel(ThreatLevel.High, "osNpcMoveTo");
m_host.AddScriptLPS(1);
INPCModule module = World.RequestModuleInterface<INPCModule>();
if (module != null)
{
UUID npcId;
if (!UUID.TryParse(npc.m_string, out npcId))
return;
if (!module.CheckPermissions(npcId, m_host.OwnerID))
return;
module.MoveToTarget(npcId, World, pos, false, true, false);
}
}
开发者ID:nebadon2025,项目名称:opensimulator,代码行数:18,代码来源:OSSL_Api.cs
示例13: osNpcGetPos
public LSL_Vector osNpcGetPos(LSL_Key npc)
{
CheckThreatLevel(ThreatLevel.High, "osNpcGetPos");
m_host.AddScriptLPS(1);
INPCModule npcModule = World.RequestModuleInterface<INPCModule>();
if (npcModule != null)
{
UUID npcId;
if (!UUID.TryParse(npc.m_string, out npcId))
return new LSL_Vector(0, 0, 0);
if (!npcModule.CheckPermissions(npcId, m_host.OwnerID))
return new LSL_Vector(0, 0, 0);
ScenePresence sp = World.GetScenePresence(npcId);
if (sp != null)
return new LSL_Vector(sp.AbsolutePosition);
}
return Vector3.Zero;
}
开发者ID:nebadon2025,项目名称:opensimulator,代码行数:23,代码来源:OSSL_Api.cs
示例14: osNpcGetOwner
public LSL_Key osNpcGetOwner(LSL_Key npc)
{
CheckThreatLevel(ThreatLevel.None, "osNpcGetOwner");
m_host.AddScriptLPS(1);
INPCModule npcModule = World.RequestModuleInterface<INPCModule>();
if (npcModule != null)
{
UUID npcId;
if (UUID.TryParse(npc.m_string, out npcId))
{
UUID owner = npcModule.GetOwner(npcId);
if (owner != UUID.Zero)
return new LSL_Key(owner.ToString());
else
return npc;
}
}
return new LSL_Key(UUID.Zero.ToString());
}
开发者ID:nebadon2025,项目名称:opensimulator,代码行数:21,代码来源:OSSL_Api.cs
示例15: osAgentSaveAppearance
public LSL_Key osAgentSaveAppearance(LSL_Key avatarId, string notecard)
{
CheckThreatLevel(ThreatLevel.VeryHigh, "osAgentSaveAppearance");
m_host.AddScriptLPS(1);
return SaveAppearanceToNotecard(avatarId, notecard);
}
开发者ID:nebadon2025,项目名称:opensimulator,代码行数:7,代码来源:OSSL_Api.cs
示例16: osNpcSetProfileImage
public void osNpcSetProfileImage(LSL_Key npc, string image)
{
CheckThreatLevel(ThreatLevel.Low, "osNpcSetProfileImage");
m_host.AddScriptLPS(1);
INPCModule module = World.RequestModuleInterface<INPCModule>();
if (module != null)
{
UUID npcId = new UUID(npc.m_string);
if (!module.CheckPermissions(npcId, m_host.OwnerID))
return;
UUID ImageID = new UUID();
ImageID = ScriptUtils.GetAssetIdFromItemName(m_host, image, (int)AssetType.Texture);
if (ImageID == null || ImageID == UUID.Zero)
{
if (!UUID.TryParse(image, out ImageID))
return;
}
ScenePresence sp = World.GetScenePresence(npcId);
if (sp != null)
((INPC)(sp.ControllingClient)).profileImage = ImageID;
}
}
开发者ID:nebadon2025,项目名称:opensimulator,代码行数:28,代码来源:OSSL_Api.cs
示例17: SaveAppearanceToNotecard
protected LSL_Key SaveAppearanceToNotecard(LSL_Key rawAvatarId, string notecard)
{
UUID avatarId;
if (!UUID.TryParse(rawAvatarId, out avatarId))
return new LSL_Key(UUID.Zero.ToString());
return SaveAppearanceToNotecard(avatarId, notecard);
}
开发者ID:nebadon2025,项目名称:opensimulator,代码行数:8,代码来源:OSSL_Api.cs
示例18: osNpcSay
public void osNpcSay(LSL_Key npc, string message)
{
osNpcSay(npc, 0, message);
}
开发者ID:nebadon2025,项目名称:opensimulator,代码行数:4,代码来源:OSSL_Api.cs
示例19: osGetPrimitiveParams
public LSL_List osGetPrimitiveParams(LSL_Key prim, LSL_List rules)
{
CheckThreatLevel(ThreatLevel.High, "osGetPrimitiveParams");
m_host.AddScriptLPS(1);
InitLSL();
return m_LSL_Api.GetPrimitiveParamsEx(prim, rules);
}
开发者ID:nebadon2025,项目名称:opensimulator,代码行数:8,代码来源:OSSL_Api.cs
示例20: osNpcSit
public void osNpcSit(LSL_Key npc, LSL_Key target, int options)
{
CheckThreatLevel(ThreatLevel.High, "osNpcSit");
m_host.AddScriptLPS(1);
INPCModule module = World.RequestModuleInterface<INPCModule>();
if (module != null)
{
UUID npcId = new UUID(npc.m_string);
if (!module.CheckPermissions(npcId, m_host.OwnerID))
return;
module.Sit(npcId, new UUID(target.m_string), World);
}
}
开发者ID:nebadon2025,项目名称:opensimulator,代码行数:16,代码来源:OSSL_Api.cs
注:本文中的OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论