public void botSetMap(string keyOfBot, LSL_List positions, LSL_List movementType, LSL_Integer flags) { if (!ScriptProtection.CheckThreatLevel(ThreatLevel.Moderate, "botSetMap", m_host, "bot", m_itemID)) { return; } List <Vector3> PositionsMap = new List <Vector3>(); for (int i = 0; i < positions.Length; i++) { LSL_Vector pos = positions.GetVector3Item(i); PositionsMap.Add(new Vector3((float)pos.x, (float)pos.y, (float)pos.z)); } List <TravelMode> TravelMap = new List <TravelMode>(); for (int i = 0; i < movementType.Length; i++) { LSL_Integer travel = movementType.GetLSLIntegerItem(i); TravelMap.Add((TravelMode)travel.value); } IBotManager manager = World.RequestModuleInterface <IBotManager>(); if (manager != null) { manager.SetBotMap(UUID.Parse(keyOfBot), PositionsMap, TravelMap, flags.value, m_host.OwnerID); } }
public void botSetMap(string keyOfBot, LSL_List positions, LSL_List movementType) { List <Vector3> PositionsMap = new List <Vector3>(); for (int i = 0; i < positions.Length; i++) { LSL_Vector pos = positions.GetVector3Item(i); PositionsMap.Add(new Vector3((float)pos.x, (float)pos.y, (float)pos.z)); } List <TravelMode> TravelMap = new List <TravelMode>(); for (int i = 0; i < movementType.Length; i++) { LSL_Integer travel = movementType.GetLSLIntegerItem(i); TravelMap.Add((TravelMode)travel.value); } IBotManager manager = World.RequestModuleInterface <IBotManager>(); if (manager != null) { manager.SetBotMap(UUID.Parse(keyOfBot), PositionsMap, TravelMap); } }
public void botSetMap(string keyOfBot, LSL_List positions, LSL_List movementType, LSL_Integer flags) { ScriptProtection.CheckThreatLevel (ThreatLevel.Moderate, "botSetMap", m_host, "bot"); List<Vector3> PositionsMap = new List<Vector3>(); for(int i = 0; i < positions.Length; i++) { LSL_Vector pos = positions.GetVector3Item(i); PositionsMap.Add(new Vector3((float)pos.x, (float)pos.y, (float)pos.z)); } List<TravelMode> TravelMap = new List<TravelMode>(); for(int i = 0; i < movementType.Length; i++) { LSL_Integer travel = movementType.GetLSLIntegerItem(i); TravelMap.Add((TravelMode)travel.value); } IBotManager manager = World.RequestModuleInterface<IBotManager>(); if (manager != null) manager.SetBotMap(UUID.Parse(keyOfBot), PositionsMap, TravelMap, flags.value); }
public void llScriptProfiler (LSL_Integer profilerFlags) { //TODO: We don't support this, not implemented }
public LSL_List llGetPrimMediaParams(LSL_Integer face, LSL_List commandList) { return m_LSL_Functions.llGetPrimMediaParams(face, commandList); }
public void llSetLinkCamera (LSL_Integer link, LSL_Vector eye, LSL_Vector at) { if(!ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL", m_itemID)) return; List<ISceneChildEntity> entities = GetLinkParts(link); if(entities.Count > 0) { entities[0].CameraEyeOffset = new Vector3((float)eye.x, (float)eye.y, (float)eye.z); entities[0].CameraAtOffset = new Vector3((float)at.x, (float)at.y, (float)at.z); } }
public LSL_Integer llSetMemoryLimit (LSL_Integer limit) { if(!ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL", m_itemID)) return new LSL_Integer(); // Make scripts designed for LSO happy return 16384; }
public void llSetContentType (LSL_Key id, LSL_Integer type) { if(!ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL", m_itemID)) return; string content_type = "text/plain"; if(type == ScriptBaseClass.CONTENT_TYPE_TEXT) content_type = "text/plain"; else if(type == ScriptBaseClass.CONTENT_TYPE_HTML) content_type = "text/html"; if(m_UrlModule != null) m_UrlModule.SetContentType(new UUID(id), content_type); }
private void ClearPrimMedia (ISceneChildEntity entity, 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 > entity.GetNumberOfSides() - 1) return; IMoapModule module = World.RequestModuleInterface<IMoapModule>(); if(null == module) throw new Exception("Media on a prim functions not available"); module.ClearMediaEntry(entity, face); }
public LSL_Integer llManageEstateAccess(LSL_Integer action, LSL_String avatar) { if (!ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL", m_itemID)) return LSL_Integer.FALSE; if (World.Permissions.IsAdministrator(m_host.OwnerID)) { if (action == ScriptBaseClass.ESTATE_ACCESS_ALLOWED_AGENT_ADD) World.RegionInfo.EstateSettings.AddEstateUser(UUID.Parse(avatar)); else if (action == ScriptBaseClass.ESTATE_ACCESS_ALLOWED_AGENT_REMOVE) World.RegionInfo.EstateSettings.RemoveEstateUser(UUID.Parse(avatar)); else if (action == ScriptBaseClass.ESTATE_ACCESS_ALLOWED_GROUP_ADD) World.RegionInfo.EstateSettings.AddEstateGroup(UUID.Parse(avatar)); else if (action == ScriptBaseClass.ESTATE_ACCESS_ALLOWED_GROUP_REMOVE) World.RegionInfo.EstateSettings.RemoveEstateGroup(UUID.Parse(avatar)); else if (action == ScriptBaseClass.ESTATE_ACCESS_BANNED_AGENT_ADD) World.RegionInfo.EstateSettings.AddBan(new EstateBan { EstateID = World.RegionInfo.EstateSettings.EstateID, BannedUserID = UUID.Parse(avatar) }); else if (action == ScriptBaseClass.ESTATE_ACCESS_BANNED_AGENT_REMOVE) World.RegionInfo.EstateSettings.RemoveBan(UUID.Parse(avatar)); return LSL_Integer.TRUE; } return LSL_Integer.FALSE; }
public LSL_List llGetLinkMedia(LSL_Integer link, LSL_Integer face, LSL_List rules) { if (!ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL", m_itemID)) return new LSL_List(); List<ISceneChildEntity> entities = GetLinkParts(link); if (entities.Count == 0 || face < 0 || face > entities[0].GetNumberOfSides() - 1) return new LSL_List(); LSL_List res = new LSL_List(); return entities.Select(part => GetPrimMediaParams(part, face, rules)).Aggregate(res, (current, partRes) => current + partRes); }
public LSL_Vector botGetWaitingTime(LSL_Integer waitTime) { return(new LSL_Vector(waitTime, 0, 0)); }
public void osSetLinkPrimitiveParams(LSL_Integer link, LSL_List rules) { if (!ScriptProtection.CheckThreatLevel(ThreatLevel.Low, "osSetLinkPrimitiveParams", m_host, "OSSL", m_itemID)) return; InitLSL(); List<IEntity> parts = m_LSL_Api.GetLinkPartsAndEntities(link); foreach (IEntity part in parts) m_LSL_Api.SetPrimParams(part, rules, true); }
public DateTime osRezObject(string inventory, LSL_Types.Vector3 pos, LSL_Types.Vector3 vel, LSL_Types.Quaternion rot, int param, LSL_Integer isRezAtRoot, LSL_Integer doRecoil, LSL_Integer SetDieAtEdge, LSL_Integer CheckPos) { return m_LSL_Api.llRezPrim(inventory, pos, vel, rot, param, isRezAtRoot == 1, doRecoil == 1, SetDieAtEdge == 1, CheckPos == 1); }
public void llSetContentType(LSL_Key id, LSL_Integer type) { if (!ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL", m_itemID)) return; string content_type = "text/plain"; if (type == ScriptBaseClass.CONTENT_TYPE_HTML) content_type = "text/html"; else if (type == ScriptBaseClass.CONTENT_TYPE_XML) content_type = "application/xml"; else if (type == ScriptBaseClass.CONTENT_TYPE_XHTML) content_type = "application/xhtml+xml"; else if (type == ScriptBaseClass.CONTENT_TYPE_ATOM) content_type = "application/atom+xml"; else if (type == ScriptBaseClass.CONTENT_TYPE_JSON) content_type = "application/json"; else if (type == ScriptBaseClass.CONTENT_TYPE_LLSD) content_type = "application/llsd+xml"; else if (type == ScriptBaseClass.CONTENT_TYPE_FORM) content_type = "application/x-www-form-urlencoded"; else if (type == ScriptBaseClass.CONTENT_TYPE_RSS) content_type = "application/rss+xml"; else content_type = "text/plain"; if (m_UrlModule != null) m_UrlModule.SetContentType(id, content_type); }
public LSL_Integer llClearPrimMedia(LSL_Integer face) { 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 (LSL_Integer)ScriptBaseClass.LSL_STATUS_OK; } IMoapModule module = World.RequestModuleInterface<IMoapModule>(); if (null == module) throw new Exception("Media on a prim functions not available"); module.ClearMediaEntry(m_host, face); return (LSL_Integer)ScriptBaseClass.LSL_STATUS_OK; }
public void aaSetEnv(LSL_String name, LSL_List value) { 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); float[] grav = m_host.ParentEntity.Scene.PhysicsScene.GetGravityForce(); 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); float[] grav = m_host.ParentEntity.Scene.PhysicsScene.GetGravityForce(); 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(); } } }
public LSL_String llTransferLindenDollars(LSL_String destination, LSL_Integer amt) { LSL_String transferID = UUID.Random().ToString(); IMoneyModule moneyMod = World.RequestModuleInterface<IMoneyModule>(); LSL_String data = ""; LSL_Integer success = LSL_Integer.FALSE; TaskInventoryItem item = m_host.TaskInventory[m_itemID]; UUID destID; if (item.PermsGranter == UUID.Zero || (item.PermsMask & ScriptBaseClass.PERMISSION_DEBIT) == 0) data = llList2CSV(new LSL_Types.list("MISSING_PERMISSION_DEBIT")); else if (!UUID.TryParse(destination, out destID)) data = llList2CSV(new LSL_Types.list("INVALID_AGENT")); else if (amt <= 0) data = llList2CSV(new LSL_Types.list("INVALID_AMOUNT")); else if (World.UserAccountService.GetUserAccount(World.RegionInfo.AllScopeIDs, destID) == null) data = llList2CSV(new LSL_Types.list("LINDENDOLLAR_ENTITYDOESNOTEXIST")); else if (m_host.ParentEntity.OwnerID == m_host.ParentEntity.GroupID) data = llList2CSV(new LSL_Types.list("GROUP_OWNED")); else if (moneyMod != null) { success = moneyMod.Transfer(UUID.Parse(destination), m_host.OwnerID, amt, ""); data = llList2CSV(success ? new LSL_List(destination, amt) : new LSL_Types.list("LINDENDOLLAR_INSUFFICIENTFUNDS")); } else data = llList2CSV(new LSL_Types.list("SERVICE_ERROR")); m_ScriptEngine.PostScriptEvent(m_itemID, m_host.UUID, new EventParams( "transaction_result", new Object[] { transferID, success, data }, new DetectParams[0]), EventPriority.FirstStart); return transferID; }
public LSL_Integer llSetLinkMedia (LSL_Integer link, LSL_Integer face, LSL_List rules) { ScriptSleep(1000); // 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 List<ISceneChildEntity> entities = GetLinkParts(link); if(entities.Count == 0 || face < 0 || face > entities[0].GetNumberOfSides() - 1) return (LSL_Integer)ScriptBaseClass.LSL_STATUS_OK; return (LSL_Integer)SetPrimMediaParams(entities[0], face, rules); }
public void llExecCharacterCmd(LSL_Integer command, LSL_List options) { IBotManager botManager = World.RequestModuleInterface<IBotManager>(); if (botManager != null) { IBotController controller = botManager.GetCharacterManager(m_host.ParentEntity.UUID); if (command == ScriptBaseClass.CHARACTER_CMD_JUMP) controller.Jump(); if (command == ScriptBaseClass.CHARACTER_CMD_STOP) controller.StopMoving(false, true); } }
public void llSetAngularVelocity (LSL_Vector force, LSL_Integer local) { if(!ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL", m_itemID)) return; Vector3 rotvelocity = new Vector3((float)force.x, (float)force.y, (float)force.z); if(local == 1) { Quaternion grot = m_host.GetWorldRotation(); Quaternion AXgrot = grot; Vector3 AXimpulsei = rotvelocity; Vector3 newimpulse = AXimpulsei * AXgrot; rotvelocity = newimpulse; } if(m_host.ParentEntity.RootChild.PhysActor != null) m_host.ParentEntity.RootChild.PhysActor.RotationalVelocity = rotvelocity; }
public void llLinkLookAt(LSL_Integer link, LSL_Vector target, double strength, double damping) { if (!ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL", m_itemID)) return; List<ISceneChildEntity> parts = GetLinkParts(link); foreach (ISceneChildEntity part in parts) LookAt(target, strength, damping, part); }
public void llLinkSitTarget (LSL_Integer link, LSL_Vector offset, LSL_Rotation rot) { if(!ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL", m_itemID)) return; // LSL quaternions can normalize to 0, normal Quaternions can't. if(rot.s == 0 && rot.x == 0 && rot.y == 0 && rot.z == 0) rot.z = 1; // ZERO_ROTATION = 0,0,0,1 List<ISceneChildEntity> entities = GetLinkParts(link); if(entities.Count == 0) return; entities[0].SitTargetPosition = new Vector3((float)offset.x, (float)offset.y, (float)offset.z); entities[0].SitTargetOrientation = Rot2Quaternion(rot); }
public void llLinkRotLookAt(LSL_Integer link, LSL_Rotation target, double strength, double damping) { if (!ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL", m_itemID)) return; Quaternion rot = new Quaternion((float) target.x, (float) target.y, (float) target.z, (float) target.s); List<ISceneChildEntity> parts = GetLinkParts(link); foreach (ISceneChildEntity part in parts) part.RotLookAt(rot, (float) strength, (float) damping); }
public LSL_Integer llClearPrimMedia(LSL_Integer face) { return m_LSL_Functions.llClearPrimMedia(face); }
/// <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 && 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; }
public DateTime osRezObject(string inventory, LSL_Vector pos, LSL_Vector vel, LSL_Rotation rot, int param, LSL_Integer isRezAtRoot, LSL_Integer doRecoil, LSL_Integer SetDieAtEdge, LSL_Integer CheckPos) { InitLSL(); return m_LSL_Api.llRezPrim(inventory, pos, vel, rot, param, isRezAtRoot == 1, doRecoil == 1, SetDieAtEdge == 1, CheckPos == 1); }
public void llSetPhysicsMaterial(LSL_Integer bits, LSL_Float density, LSL_Float friction, LSL_Float restitution, LSL_Float gravityMultiplier) { ObjectFlagUpdatePacket.ExtraPhysicsBlock[] blocks = new ObjectFlagUpdatePacket.ExtraPhysicsBlock[1]; blocks[0] = new ObjectFlagUpdatePacket.ExtraPhysicsBlock(); if ((bits & ScriptBaseClass.DENSITY) == ScriptBaseClass.DENSITY) m_host.Density = (float) density; else blocks[0].Density = m_host.Density; if ((bits & ScriptBaseClass.FRICTION) == ScriptBaseClass.FRICTION) m_host.Friction = (float) friction; else blocks[0].Friction = m_host.Friction; if ((bits & ScriptBaseClass.RESTITUTION) == ScriptBaseClass.RESTITUTION) m_host.Restitution = (float) restitution; else blocks[0].Restitution = m_host.Restitution; if ((bits & ScriptBaseClass.GRAVITY_MULTIPLIER) == ScriptBaseClass.GRAVITY_MULTIPLIER) m_host.GravityMultiplier = (float) gravityMultiplier; else blocks[0].GravityMultiplier = m_host.GravityMultiplier; bool UsePhysics = ((m_host.Flags & PrimFlags.Physics) != 0); bool IsTemporary = ((m_host.Flags & PrimFlags.TemporaryOnRez) != 0); bool IsPhantom = ((m_host.Flags & PrimFlags.Phantom) != 0); bool IsVolumeDetect = m_host.VolumeDetectActive; blocks[0].PhysicsShapeType = m_host.PhysicsType; if (m_host.UpdatePrimFlags(UsePhysics, IsTemporary, IsPhantom, IsVolumeDetect, blocks)) m_host.ParentEntity.RebuildPhysicalRepresentation(true, null); }
public LSL_Vector botGetWaitingTime (LSL_Integer waitTime) { return new LSL_Vector (waitTime, 0, 0); }
public LSL_List llGetLinkMedia (LSL_Integer link, LSL_Integer face, LSL_List rules) { if(!ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL", m_itemID)) return new LSL_List(); List<ISceneChildEntity> entities = GetLinkParts(link); if(entities.Count == 0 || face < 0 || face > entities[0].GetNumberOfSides() - 1) return new LSL_List(); else return GetPrimMediaParams(entities[0], face, rules); }
public LSL_List llGetPrimMediaParams(LSL_Integer face, LSL_List rules) { ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL"); ScriptSleep(1000); // LSL Spec http://wiki.secondlife.com/wiki/LlGetPrimMediaParams says to fail silently if face is invalid // TODO: Need to correctly handle case where a face has no media (which gives back an empty list). // Assuming silently fail means give back an empty list. Ideally, need to check this. if (face < 0 || face > m_host.GetNumberOfSides() - 1) return new LSL_List(); else return GetPrimMediaParams(face, rules); }
public LSL_Integer llClearPrimMedia (LSL_Integer face) { if(!ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL", m_itemID)) return 0; ScriptSleep(1000); ClearPrimMedia(m_host, face); return (LSL_Integer)ScriptBaseClass.LSL_STATUS_OK; }
public LSL_Integer llSetPrimMediaParams(LSL_Integer face, LSL_List rules) { ScriptSleep(1000); // 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 > m_host.GetNumberOfSides() - 1) return (LSL_Integer)ScriptBaseClass.LSL_STATUS_OK; else return (LSL_Integer)SetPrimMediaParams(face, rules); }
public LSL_Integer llClearLinkMedia (LSL_Integer link, LSL_Integer face) { if(!ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL", m_itemID)) return 0; ScriptSleep(1000); List<ISceneChildEntity> entities = GetLinkParts(link); if(entities.Count == 0 || face < 0 || face > entities[0].GetNumberOfSides() - 1) return (LSL_Integer)ScriptBaseClass.LSL_STATUS_OK; ClearPrimMedia(m_host, face); return (LSL_Integer)ScriptBaseClass.LSL_STATUS_OK; }