本文整理汇总了C#中OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLInteger类的典型用法代码示例。如果您正苦于以下问题:C# OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLInteger类的具体用法?C# OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLInteger怎么用?C# OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLInteger使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLInteger类属于命名空间,在下文中一共展示了OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLInteger类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: 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;
}
开发者ID:OpenPlex-Sim,项目名称:opensim,代码行数:100,代码来源:LSL_Api.cs
示例2: modInvokeL
public LSL_List modInvokeL(string fname, params object[] parms)
{
// m_log.DebugFormat(
// "[MOD API]: Invoking dynamic function {0}, args '{1}' with {2} return type",
// fname,
// string.Join(",", Array.ConvertAll<object, string>(parms, o => o.ToString())),
// ((MethodInfo)MethodBase.GetCurrentMethod()).ReturnType);
Type returntype = m_comms.LookupReturnType(fname);
if (returntype != typeof(object[]))
MODError(String.Format("return type mismatch for {0}",fname));
object[] result = (object[])modInvoke(fname,parms);
object[] llist = new object[result.Length];
for (int i = 0; i < result.Length; i++)
{
if (result[i] is string)
{
llist[i] = new LSL_String((string)result[i]);
}
else if (result[i] is int)
{
llist[i] = new LSL_Integer((int)result[i]);
}
else if (result[i] is float)
{
llist[i] = new LSL_Float((float)result[i]);
}
else if (result[i] is double)
{
llist[i] = new LSL_Float((double)result[i]);
}
else if (result[i] is UUID)
{
llist[i] = new LSL_Key(result[i].ToString());
}
else if (result[i] is OpenMetaverse.Vector3)
{
OpenMetaverse.Vector3 vresult = (OpenMetaverse.Vector3)result[i];
llist[i] = new LSL_Vector(vresult.X, vresult.Y, vresult.Z);
}
else if (result[i] is OpenMetaverse.Quaternion)
{
OpenMetaverse.Quaternion qresult = (OpenMetaverse.Quaternion)result[i];
llist[i] = new LSL_Rotation(qresult.X, qresult.Y, qresult.Z, qresult.W);
}
else
{
MODError(String.Format("unknown list element {1} returned by {0}", fname, result[i].GetType().Name));
}
}
return new LSL_List(llist);
}
开发者ID:Kubwa,项目名称:opensim,代码行数:54,代码来源:MOD_Api.cs
示例3: ClearPrimMedia
private LSL_Integer ClearPrimMedia(SceneObjectPart part, LSL_Integer face)
{
// LSL Spec http://wiki.secondlife.com/wiki/LlClearPrimMedia says to fail silently if face is invalid
// Assuming silently fail means sending back LSL_STATUS_OK. Ideally, need to check this.
// FIXME: 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;
module.ClearMediaEntry(part, face);
return ScriptBaseClass.LSL_STATUS_OK;
}
开发者ID:OpenPlex-Sim,项目名称:opensim,代码行数:16,代码来源:LSL_Api.cs
示例4: 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
示例5: llSetPrimMediaParams
public LSL_Integer llSetPrimMediaParams(LSL_Integer face, LSL_List rules)
{
m_host.AddScriptLPS(1);
ScriptSleep(1000);
return SetPrimMediaParams(m_host, face, rules);
}
开发者ID:OpenPlex-Sim,项目名称:opensim,代码行数:6,代码来源:LSL_Api.cs
示例6: llClearPrimMedia
public LSL_Integer llClearPrimMedia(LSL_Integer face)
{
m_host.AddScriptLPS(1);
ScriptSleep(1000);
return ClearPrimMedia(m_host, face);
}
开发者ID:OpenPlex-Sim,项目名称:opensim,代码行数:6,代码来源:LSL_Api.cs
示例7: llScriptProfiler
public void llScriptProfiler(LSL_Integer flags)
{
m_host.AddScriptLPS(1);
// This does nothing for LSO scripts in SL
}
开发者ID:OpenPlex-Sim,项目名称:opensim,代码行数:5,代码来源:LSL_Api.cs
示例8: llLinkSitTarget
public void llLinkSitTarget(LSL_Integer link, LSL_Vector offset, LSL_Rotation rot)
{
m_host.AddScriptLPS(1);
if (link == ScriptBaseClass.LINK_ROOT)
SitTarget(m_host.ParentGroup.RootPart, offset, rot);
else if (link == ScriptBaseClass.LINK_THIS)
SitTarget(m_host, offset, rot);
else
{
SceneObjectPart part = m_host.ParentGroup.GetLinkNumPart(link);
if (null != part)
{
SitTarget(part, offset, rot);
}
}
}
开发者ID:OpenPlex-Sim,项目名称:opensim,代码行数:16,代码来源:LSL_Api.cs
示例9: llRegionSayTo
public void llRegionSayTo( LSL_Key target, LSL_Integer channel, LSL_String msg )
{
m_host.AddScriptLPS(1);
NotImplemented("llRegionSayTo");
}
开发者ID:BackupTheBerlios,项目名称:seleon,代码行数:6,代码来源:LSL_Api.cs
示例10: llScriptProfiler
public void llScriptProfiler( LSL_Integer flags )
{
m_host.AddScriptLPS(1);
NotImplemented("llScriptProfiler");
}
开发者ID:BackupTheBerlios,项目名称:seleon,代码行数:6,代码来源:LSL_Api.cs
示例11: llSetLinkCamera
public void llSetLinkCamera(LSL_Integer link, LSL_Vector eye, LSL_Vector at)
{
m_host.AddScriptLPS(1);
if (link == ScriptBaseClass.LINK_SET ||
link == ScriptBaseClass.LINK_ALL_CHILDREN ||
link == ScriptBaseClass.LINK_ALL_OTHERS) return;
SceneObjectPart part = null;
switch (link)
{
case ScriptBaseClass.LINK_ROOT:
part = m_host.ParentGroup.RootPart;
break;
case ScriptBaseClass.LINK_THIS:
part = m_host;
break;
default:
part = m_host.ParentGroup.GetLinkNumPart(link);
break;
}
if (null != part)
{
part.SetCameraEyeOffset(eye);
part.SetCameraAtOffset(at);
}
}
开发者ID:Barosonix,项目名称:Barosonix-Core,代码行数:29,代码来源:LSL_Api.cs
示例12: osNpcTouch
public void osNpcTouch(LSL_Key npcLSL_Key, LSL_Key object_key, LSL_Integer link_num)
{
m_OSSL_Functions.osNpcTouch(npcLSL_Key, object_key, link_num);
}
开发者ID:emperorstarfinder,项目名称:Opensim2,代码行数:4,代码来源:OSSL_Stub.cs
示例13: llSetContentType
public void llSetContentType(LSL_Key id, LSL_Integer type)
{
m_host.AddScriptLPS(1);
if (m_UrlModule == null)
return;
// Make sure the content type is text/plain to start with
m_UrlModule.HttpContentType(new UUID(id), "text/plain");
// Is the object owner online and in the region
ScenePresence agent = World.GetScenePresence(m_host.ParentGroup.OwnerID);
if (agent == null || agent.IsChildAgent)
return; // Fail if the owner is not in the same region
// Is it the embeded browser?
string userAgent = m_UrlModule.GetHttpHeader(new UUID(id), "user-agent");
if (userAgent.IndexOf("SecondLife") < 0)
return; // Not the embedded browser. Is this check good enough?
// Use the IP address of the client and check against the request
// seperate logins from the same IP will allow all of them to get non-text/plain as long
// as the owner is in the region. Same as SL!
string logonFromIPAddress = agent.ControllingClient.RemoteEndPoint.Address.ToString();
string requestFromIPAddress = m_UrlModule.GetHttpHeader(new UUID(id), "remote_addr");
//m_log.Debug("IP from header='" + requestFromIPAddress + "' IP from endpoint='" + logonFromIPAddress + "'");
if (requestFromIPAddress == null || requestFromIPAddress.Trim() == "")
return;
if (logonFromIPAddress == null || logonFromIPAddress.Trim() == "")
return;
// If the request isnt from the same IP address then the request cannot be from the owner
if (!requestFromIPAddress.Trim().Equals(logonFromIPAddress.Trim()))
return;
switch (type)
{
case ScriptBaseClass.CONTENT_TYPE_HTML:
m_UrlModule.HttpContentType(new UUID(id), "text/html");
break;
case ScriptBaseClass.CONTENT_TYPE_XML:
m_UrlModule.HttpContentType(new UUID(id), "application/xml");
break;
case ScriptBaseClass.CONTENT_TYPE_XHTML:
m_UrlModule.HttpContentType(new UUID(id), "application/xhtml+xml");
break;
case ScriptBaseClass.CONTENT_TYPE_ATOM:
m_UrlModule.HttpContentType(new UUID(id), "application/atom+xml");
break;
case ScriptBaseClass.CONTENT_TYPE_JSON:
m_UrlModule.HttpContentType(new UUID(id), "application/json");
break;
case ScriptBaseClass.CONTENT_TYPE_LLSD:
m_UrlModule.HttpContentType(new UUID(id), "application/llsd+xml");
break;
case ScriptBaseClass.CONTENT_TYPE_FORM:
m_UrlModule.HttpContentType(new UUID(id), "application/x-www-form-urlencoded");
break;
case ScriptBaseClass.CONTENT_TYPE_RSS:
m_UrlModule.HttpContentType(new UUID(id), "application/rss+xml");
break;
default:
m_UrlModule.HttpContentType(new UUID(id), "text/plain");
break;
}
}
开发者ID:Barosonix,项目名称:Barosonix-Core,代码行数:66,代码来源:LSL_Api.cs
示例14: llSetLinkMedia
public LSL_Integer llSetLinkMedia(LSL_Integer link, LSL_Integer face, LSL_List rules)
{
m_host.AddScriptLPS(1);
ScriptSleep(m_sleepMsOnSetLinkMedia);
if (link == ScriptBaseClass.LINK_ROOT)
return SetPrimMediaParams(m_host.ParentGroup.RootPart, face, rules);
else if (link == ScriptBaseClass.LINK_THIS)
return SetPrimMediaParams(m_host, face, rules);
else
{
SceneObjectPart part = m_host.ParentGroup.GetLinkNumPart(link);
if (null != part)
return SetPrimMediaParams(part, face, rules);
}
return ScriptBaseClass.LSL_STATUS_NOT_FOUND;
}
开发者ID:Gitlab11,项目名称:opensim,代码行数:17,代码来源:LSL_Api.cs
示例15: llSetLinkCamera
public void llSetLinkCamera(LSL_Integer link, LSL_Vector eye, LSL_Vector at)
{
m_LSL_Functions.llSetLinkCamera(link, eye, at);
}
开发者ID:justasabc,项目名称:opensim75grid,代码行数:4,代码来源:LSL_Stub.cs
示例16: llGetAgentList
public LSL_List llGetAgentList(LSL_Integer scope, LSL_List options)
{
return m_LSL_Functions.llGetAgentList(scope, options);
}
开发者ID:p07r0457,项目名称:opensim,代码行数:4,代码来源:LSL_Stub.cs
示例17: llClearPrimMedia
public LSL_Integer llClearPrimMedia(LSL_Integer face)
{
m_host.AddScriptLPS(1);
ScriptSleep(1000);
// LSL Spec http://wiki.secondlife.com/wiki/LlClearPrimMedia says to fail silently if face is invalid
// Assuming silently fail means sending back LSL_STATUS_OK. Ideally, need to check this.
// FIXME: Don't perform the media check directly
if (face < 0 || face > m_host.GetNumberOfSides() - 1)
return ScriptBaseClass.LSL_STATUS_OK;
IMoapModule module = m_ScriptEngine.World.RequestModuleInterface<IMoapModule>();
if (null == module)
throw new Exception("Media on a prim functions not available");
module.ClearMediaEntry(m_host, face);
return ScriptBaseClass.LSL_STATUS_OK;
}
开发者ID:BackupTheBerlios,项目名称:seleon,代码行数:19,代码来源:LSL_Api.cs
示例18: llSetMemoryLimit
public LSL_Integer llSetMemoryLimit(LSL_Integer limit)
{
m_host.AddScriptLPS(1);
// Treat as an LSO script
return ScriptBaseClass.FALSE;
}
开发者ID:OpenPlex-Sim,项目名称:opensim,代码行数:6,代码来源:LSL_Api.cs
示例19: llScriptProfiler
public void llScriptProfiler(LSL_Integer flags)
{
m_LSL_Functions.llScriptProfiler(flags);
}
开发者ID:p07r0457,项目名称:opensim,代码行数:4,代码来源:LSL_Stub.cs
示例20: 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)
{
m_host.AddScriptLPS(1);
// 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;
}
ILandObject land;
Vector3 pos;
UUID id = UUID.Zero;
if (parcel || parcelOwned)
{
pos = m_host.ParentGroup.RootPart.GetWorldPosition();
land = World.LandChannel.GetLandObject(pos.X, pos.Y);
if (land == null)
{
id = UUID.Zero;
}
else
{
if (parcelOwned)
{
id = land.LandData.OwnerID;
}
else
{
id = land.LandData.GlobalID;
}
}
}
List<UUID> presenceIds = new List<UUID>();
World.ForEachRootScenePresence(
delegate (ScenePresence ssp)
{
// Gods are not listed in SL
if (!ssp.IsDeleted && ssp.GodLevel == 0.0 && !ssp.IsChildAgent)
{
if (!regionWide)
{
pos = ssp.AbsolutePosition;
land = World.LandChannel.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:OpenPlex-Sim,项目名称:opensim,代码行数:85,代码来源:LSL_Api.cs
注:本文中的OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLInteger类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论