Esempio n. 1
0
        private void sendDetailedEstateData(IClientAPI remote_client, UUID invoice)
        {
            uint sun = 0;

            if (!m_scene.RegionInfo.EstateSettings.UseGlobalTime)
                sun=(uint)(m_scene.RegionInfo.EstateSettings.SunPosition*1024.0) + 0x1800;
            UUID estateOwner;
            if (m_scene.RegionInfo.EstateSettings.EstateOwner != UUID.Zero)
                estateOwner = m_scene.RegionInfo.EstateSettings.EstateOwner;
            else
                estateOwner = m_scene.RegionInfo.MasterAvatarAssignedUUID;

            if (m_scene.Permissions.IsGod(remote_client.AgentId))
                estateOwner = remote_client.AgentId;

            remote_client.SendDetailedEstateData(invoice,
                    m_scene.RegionInfo.EstateSettings.EstateName,
                    m_scene.RegionInfo.EstateSettings.EstateID,
                    m_scene.RegionInfo.EstateSettings.ParentEstateID,
                    GetEstateFlags(),
                    sun,
                    m_scene.RegionInfo.RegionSettings.Covenant,
                    m_scene.RegionInfo.EstateSettings.AbuseEmail,
                    estateOwner);

            remote_client.SendEstateManagersList(invoice,
                    m_scene.RegionInfo.EstateSettings.EstateManagers,
                    m_scene.RegionInfo.EstateSettings.EstateID);

            remote_client.SendBannedUserList(invoice,
                    m_scene.RegionInfo.EstateSettings.EstateBans,
                    m_scene.RegionInfo.EstateSettings.EstateID);
        }
Esempio n. 2
0
        private void sendDetailedEstateData(IClientAPI remote_client, UUID invoice)
        {
            uint sun = 0;

            if (!m_scene.RegionInfo.EstateSettings.UseGlobalTime)
            {
                sun = (uint)(m_scene.RegionInfo.EstateSettings.SunPosition * 1024.0) + 0x1800;
            }
            UUID estateOwner;

            if (m_scene.RegionInfo.EstateSettings.EstateOwner != UUID.Zero)
            {
                estateOwner = m_scene.RegionInfo.EstateSettings.EstateOwner;
            }
            else
            {
                estateOwner = m_scene.RegionInfo.MasterAvatarAssignedUUID;
            }

            if (m_scene.Permissions.IsGod(remote_client.AgentId))
            {
                estateOwner = remote_client.AgentId;
            }

            remote_client.SendDetailedEstateData(invoice,
                                                 m_scene.RegionInfo.EstateSettings.EstateName,
                                                 m_scene.RegionInfo.EstateSettings.EstateID,
                                                 m_scene.RegionInfo.EstateSettings.ParentEstateID,
                                                 GetEstateFlags(),
                                                 sun,
                                                 m_scene.RegionInfo.RegionSettings.Covenant,
                                                 m_scene.RegionInfo.EstateSettings.AbuseEmail,
                                                 estateOwner);

            remote_client.SendEstateManagersList(invoice,
                                                 m_scene.RegionInfo.EstateSettings.EstateManagers,
                                                 m_scene.RegionInfo.EstateSettings.EstateID);

            remote_client.SendBannedUserList(invoice,
                                             m_scene.RegionInfo.EstateSettings.EstateBans,
                                             m_scene.RegionInfo.EstateSettings.EstateID);
        }
Esempio n. 3
0
        private void handleEstateAccessDeltaRequest(IClientAPI remote_client, UUID invoice, int estateAccessType, UUID user)
        {
            // EstateAccessDelta handles Estate Managers, Sim Access, Sim Banlist, allowed Groups..  etc.

            if (user == m_scene.RegionInfo.EstateSettings.EstateOwner)
            {
                return; // never process EO
            }
            if (user == m_scene.RegionInfo.MasterAvatarAssignedUUID)
            {
                return; // never process owner
            }
            switch (estateAccessType)
            {
            case 64:
                if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, false) || m_scene.Permissions.BypassPermissions())
                {
                    EstateBan[] banlistcheck = m_scene.RegionInfo.EstateSettings.EstateBans;

                    bool alreadyInList = false;

                    for (int i = 0; i < banlistcheck.Length; i++)
                    {
                        if (user == banlistcheck[i].BannedUserID)
                        {
                            alreadyInList = true;
                            break;
                        }
                    }
                    if (!alreadyInList)
                    {
                        EstateBan item = new EstateBan();

                        item.BannedUserID      = user;
                        item.EstateID          = m_scene.RegionInfo.EstateSettings.EstateID;
                        item.BannedHostAddress = "0.0.0.0";
                        item.BannedHostIPMask  = "0.0.0.0";

                        m_scene.RegionInfo.EstateSettings.AddBan(item);
                        m_scene.RegionInfo.EstateSettings.Save();

                        ScenePresence s = m_scene.GetScenePresence(user);
                        if (s != null)
                        {
                            if (!s.IsChildAgent)
                            {
                                s.ControllingClient.SendTeleportLocationStart();
                                m_scene.TeleportClientHome(user, s.ControllingClient);
                            }
                        }
                    }
                    else
                    {
                        remote_client.SendAlertMessage("User is already on the region ban list");
                    }
                    //m_scene.RegionInfo.regionBanlist.Add(Manager(user);
                    remote_client.SendBannedUserList(invoice, m_scene.RegionInfo.EstateSettings.EstateBans, m_scene.RegionInfo.EstateSettings.EstateID);
                }
                else
                {
                    remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions");
                }
                break;

            case 128:
                if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, false) || m_scene.Permissions.BypassPermissions())
                {
                    EstateBan[] banlistcheck = m_scene.RegionInfo.EstateSettings.EstateBans;

                    bool      alreadyInList = false;
                    EstateBan listitem      = null;

                    for (int i = 0; i < banlistcheck.Length; i++)
                    {
                        if (user == banlistcheck[i].BannedUserID)
                        {
                            alreadyInList = true;
                            listitem      = banlistcheck[i];
                            break;
                        }
                    }
                    if (alreadyInList && listitem != null)
                    {
                        m_scene.RegionInfo.EstateSettings.RemoveBan(listitem.BannedUserID);
                        m_scene.RegionInfo.EstateSettings.Save();
                    }
                    else
                    {
                        remote_client.SendAlertMessage("User is not on the region ban list");
                    }
                    //m_scene.RegionInfo.regionBanlist.Add(Manager(user);
                    remote_client.SendBannedUserList(invoice, m_scene.RegionInfo.EstateSettings.EstateBans, m_scene.RegionInfo.EstateSettings.EstateID);
                }
                else
                {
                    remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions");
                }
                break;

            case 256:

                if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || m_scene.Permissions.BypassPermissions())
                {
                    m_scene.RegionInfo.EstateSettings.AddEstateManager(user);
                    m_scene.RegionInfo.EstateSettings.Save();
                    remote_client.SendEstateManagersList(invoice, m_scene.RegionInfo.EstateSettings.EstateManagers, m_scene.RegionInfo.EstateSettings.EstateID);
                }
                else
                {
                    remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions");
                }

                break;

            case 512:
                if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || m_scene.Permissions.BypassPermissions())
                {
                    m_scene.RegionInfo.EstateSettings.RemoveEstateManager(user);
                    m_scene.RegionInfo.EstateSettings.Save();

                    remote_client.SendEstateManagersList(invoice, m_scene.RegionInfo.EstateSettings.EstateManagers, m_scene.RegionInfo.EstateSettings.EstateID);
                }
                else
                {
                    remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions");
                }
                break;

            default:

                m_log.ErrorFormat("EstateOwnerMessage: Unknown EstateAccessType requested in estateAccessDelta: {0}", estateAccessType.ToString());
                break;
            }
        }
Esempio n. 4
0
        private void handleEstateAccessDeltaRequest(IClientAPI remote_client, UUID invoice, int estateAccessType, UUID user)
        {
            // EstateAccessDelta handles Estate Managers, Sim Access, Sim Banlist, allowed Groups..  etc.

            if (user == m_scene.RegionInfo.EstateSettings.EstateOwner)
                return; // never process EO
            if (user == m_scene.RegionInfo.MasterAvatarAssignedUUID)
                return; // never process owner

            switch (estateAccessType)
            {
                case 64:
                    if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, false) || m_scene.Permissions.BypassPermissions())
                    {
                        EstateBan[] banlistcheck = m_scene.RegionInfo.EstateSettings.EstateBans;

                        bool alreadyInList = false;

                        for (int i = 0; i < banlistcheck.Length; i++)
                        {
                            if (user == banlistcheck[i].BannedUserID)
                            {
                                alreadyInList = true;
                                break;
                            }

                        }
                        if (!alreadyInList)
                        {

                            EstateBan item = new EstateBan();

                            item.BannedUserID = user;
                            item.EstateID = m_scene.RegionInfo.EstateSettings.EstateID;
                            item.BannedHostAddress = "0.0.0.0";
                            item.BannedHostIPMask = "0.0.0.0";

                            m_scene.RegionInfo.EstateSettings.AddBan(item);
                            m_scene.RegionInfo.EstateSettings.Save();

                            ScenePresence s = m_scene.GetScenePresence(user);
                            if (s != null)
                            {
                                if (!s.IsChildAgent)
                                {
                                    s.ControllingClient.SendTeleportLocationStart();
                                    m_scene.TeleportClientHome(user, s.ControllingClient);
                                }
                            }

                        }
                        else
                        {
                            remote_client.SendAlertMessage("User is already on the region ban list");
                        }
                        //m_scene.RegionInfo.regionBanlist.Add(Manager(user);
                        remote_client.SendBannedUserList(invoice, m_scene.RegionInfo.EstateSettings.EstateBans, m_scene.RegionInfo.EstateSettings.EstateID);
                    }
                    else
                    {
                        remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions");
                    }
                    break;
                case 128:
                    if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, false) || m_scene.Permissions.BypassPermissions())
                    {
                        EstateBan[] banlistcheck = m_scene.RegionInfo.EstateSettings.EstateBans;

                        bool alreadyInList = false;
                        EstateBan listitem = null;

                        for (int i = 0; i < banlistcheck.Length; i++)
                        {
                            if (user == banlistcheck[i].BannedUserID)
                            {
                                alreadyInList = true;
                                listitem = banlistcheck[i];
                                break;
                            }

                        }
                        if (alreadyInList && listitem != null)
                        {
                            m_scene.RegionInfo.EstateSettings.RemoveBan(listitem.BannedUserID);
                            m_scene.RegionInfo.EstateSettings.Save();
                        }
                        else
                        {
                            remote_client.SendAlertMessage("User is not on the region ban list");
                        }
                        //m_scene.RegionInfo.regionBanlist.Add(Manager(user);
                        remote_client.SendBannedUserList(invoice, m_scene.RegionInfo.EstateSettings.EstateBans, m_scene.RegionInfo.EstateSettings.EstateID);
                    }
                    else
                    {
                        remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions");
                    }
                    break;
                case 256:

                    if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || m_scene.Permissions.BypassPermissions())
                    {
                        m_scene.RegionInfo.EstateSettings.AddEstateManager(user);
                        m_scene.RegionInfo.EstateSettings.Save();
                        remote_client.SendEstateManagersList(invoice, m_scene.RegionInfo.EstateSettings.EstateManagers, m_scene.RegionInfo.EstateSettings.EstateID);
                    }
                    else
                    {
                        remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions");
                    }

                    break;
                case 512:
                    if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || m_scene.Permissions.BypassPermissions())
                    {
                        m_scene.RegionInfo.EstateSettings.RemoveEstateManager(user);
                        m_scene.RegionInfo.EstateSettings.Save();

                        remote_client.SendEstateManagersList(invoice, m_scene.RegionInfo.EstateSettings.EstateManagers, m_scene.RegionInfo.EstateSettings.EstateID);
                    }
                    else
                    {
                        remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions");
                    }
                    break;

                default:

                    m_log.ErrorFormat("EstateOwnerMessage: Unknown EstateAccessType requested in estateAccessDelta: {0}", estateAccessType.ToString());
                    break;
            }
        }