public void SendDialogToUser(
            UUID avatarID, string objectName, UUID objectID, UUID ownerID,
            string message, UUID textureID, int ch, string [] buttonlabels)
        {
            UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.AllScopeIDs, ownerID);
            string      ownerFirstName, ownerLastName;

            if (account != null)
            {
                ownerFirstName = account.FirstName;
                ownerLastName  = account.LastName;
            }
            else
            {
                ownerFirstName = "(unknown";
                ownerLastName  = "user)";
            }

            //If the user is muted, we do NOT send them dialog boxes
            if (m_muteListModule != null)
            {
                bool cached; // Not used but needed for call

                if (m_muteListModule.GetMutes(avatarID, out cached).Any(mute => mute.MuteID == ownerID))
                {
                    return;
                }
            }

            IScenePresence sp = m_scene.GetScenePresence(avatarID);

            if (sp != null && !sp.IsChildAgent)
            {
                sp.ControllingClient.SendDialog(
                    objectName,
                    objectID,
                    ownerID,
                    ownerFirstName,
                    ownerLastName,
                    message,
                    textureID,
                    ch,
                    buttonlabels);
            }
        }
Example #2
0
        public DateTime llMapDestination(string simname, LSL_Vector pos, LSL_Vector lookAt)
        {
            if (!ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL", m_itemID))
            {
                return(DateTime.Now);
            }

            UUID         avatarID       = m_host.OwnerID;
            DetectParams detectedParams = m_ScriptEngine.GetDetectParams(m_host.UUID, m_itemID, 0);

            // only works on the first detected avatar
            //This only works in touch events or if the item is attached to the avatar
            if (detectedParams == null && !m_host.IsAttachment)
            {
                return(DateTime.Now);
            }

            if (detectedParams != null)
            {
                avatarID = detectedParams.Key;
            }

            IScenePresence avatar = World.GetScenePresence(avatarID);

            if (avatar != null)
            {
                IMuteListModule module = m_host.ParentEntity.Scene.RequestModuleInterface <IMuteListModule>();
                if (module != null)
                {
                    bool cached = false; //Unneeded
                    if (module.GetMutes(avatar.UUID, out cached).Any(mute => mute.MuteID == m_host.OwnerID))
                    {
                        return(DateTime.Now); //If the avatar is muted, they don't get any contact from the muted av
                    }
                }
                avatar.ControllingClient.SendScriptTeleportRequest(m_host.Name, simname,
                                                                   new Vector3((float)pos.x, (float)pos.y,
                                                                               (float)pos.z),
                                                                   new Vector3((float)lookAt.x, (float)lookAt.y,
                                                                               (float)lookAt.z));
            }
            return(PScriptSleep(m_sleepMsOnMapDestination));
        }