Ejemplo n.º 1
0
        /// <summary>
        /// Remove a specific script (and all its pending commands)
        /// </summary>
        /// <param name="localID"></param>
        /// <param name="itemID"></param>
        public static void RemoveScript(IScriptEngine engine, uint localID, UUID itemID)
        {
            // Remove a specific script

            // Remove dataserver events
            m_Dataserver[engine].RemoveEvents(localID, itemID);

            // Remove from: Timers
            m_Timer[engine].UnSetTimerEvents(localID, itemID);

            // Remove from: HttpRequest
            IHttpRequestModule iHttpReq =
                engine.World.RequestModuleInterface <IHttpRequestModule>();

            iHttpReq.StopHttpRequest(localID, itemID);

            IWorldComm comms = engine.World.RequestModuleInterface <IWorldComm>();

            if (comms != null)
            {
                comms.DeleteListener(itemID);
            }

            IXMLRPC xmlrpc = engine.World.RequestModuleInterface <IXMLRPC>();

            xmlrpc.DeleteChannels(itemID);
            xmlrpc.CancelSRDRequests(itemID);

            // Remove Sensors
            m_SensorRepeat[engine].UnSetSenseRepeaterEvents(localID, itemID);
        }
Ejemplo n.º 2
0
        public void CreateFromData(uint localID, UUID itemID, UUID hostID,
                                   Object[] data)
        {
            IWorldComm comms = m_CmdManager.m_ScriptEngine.World.RequestModuleInterface <IWorldComm>();

            comms.CreateFromData(localID, itemID, hostID, data);
        }
Ejemplo n.º 3
0
        public void CheckListeners()
        {
            if (m_CmdManager.m_ScriptEngine.World == null)
            {
                return;
            }
            IWorldComm comms = m_CmdManager.m_ScriptEngine.World.RequestModuleInterface <IWorldComm>();

            if (comms != null)
            {
                while (comms.HasMessages())
                {
                    ListenerInfo lInfo = (ListenerInfo)comms.GetNextMessage();

                    //Deliver data to prim's listen handler
                    object[] resobj = new object[]
                    {
                        new LSL_Types.LSLInteger(lInfo.GetChannel()),
                        new LSL_Types.LSLString(lInfo.GetName()),
                        new LSL_Types.LSLString(lInfo.GetID().ToString()),
                        new LSL_Types.LSLString(lInfo.GetMessage())
                    };

                    foreach (IScriptEngine e in m_CmdManager.ScriptEngines)
                    {
                        e.PostScriptEvent(
                            lInfo.GetItemID(), new EventParams(
                                "listen", resobj,
                                new DetectParams[0]));
                    }
                }
            }
        }
Ejemplo n.º 4
0
        public void aaSayDistance(int channelID, LSL_Float Distance, string text)
        {
            ScriptProtection.CheckThreatLevel(ThreatLevel.VeryLow, "AASayDistance", m_host, "AA");

            if (text.Length > 1023)
            {
                text = text.Substring(0, 1023);
            }

            IChatModule chatModule = World.RequestModuleInterface <IChatModule>();

            if (chatModule != null)
            {
                chatModule.SimChat(text, ChatTypeEnum.Custom, channelID,
                                   m_host.ParentEntity.RootChild.AbsolutePosition, m_host.Name,
                                   m_host.UUID, false, false, (float)Distance.value, UUID.Zero, World);
            }

            IWorldComm wComm = World.RequestModuleInterface <IWorldComm>();

            if (wComm != null)
            {
                wComm.DeliverMessage(ChatTypeEnum.Custom, channelID, m_host.Name, m_host.UUID, text, (float)Distance.value);
            }
        }
Ejemplo n.º 5
0
        public void AddRegion(Scene scene)
        {
            if (ConfigSource.Configs[ScriptEngineName] == null)
            {
                ConfigSource.AddConfig(ScriptEngineName);
            }

            _scriptConfigSource = ConfigSource.Configs[ScriptEngineName];

            _enabled = _scriptConfigSource.GetBoolean("Enabled", true);

            if (!_enabled)
            {
                return;
            }

            IWorldComm comms = scene.RequestModuleInterface <IWorldComm>();

            if (comms == null)
            {
                _log.Error("[Phlox]: Script engine can not start, no worldcomm module found");
                return;
            }

            comms.SetWorkArrivedDelegate(this.WorkArrived);

            _scene = scene;

            _exeScheduler = new ExecutionScheduler(this.WorkArrived, this, comms);
            _stateManager = new StateManager(_exeScheduler);
            _exeScheduler.StateManager = _stateManager;

            _scriptLoader = new ScriptLoader(scene.CommsManager.AssetCache, _exeScheduler, this.WorkArrived, this);
            _scriptLoader.StateManager = _stateManager;

            _masterScheduler = new MasterScheduler(_exeScheduler, _scriptLoader, _stateManager);
            _stateManager.MMasterScheduler = _masterScheduler;
            _eventRouter = new EventRouter(this);

            _scene.EventManager.OnRezScript               += new EventManager.NewRezScript(EventManager_OnRezScript);
            _scene.EventManager.OnRemoveScript            += new EventManager.RemoveScript(EventManager_OnRemoveScript);
            _scene.EventManager.OnReloadScript            += new EventManager.ReloadScript(EventManager_OnReloadScript);
            _scene.EventManager.OnScriptReset             += new EventManager.ScriptResetDelegate(EventManager_OnScriptReset);
            _scene.EventManager.OnGetScriptRunning        += new EventManager.GetScriptRunning(EventManager_OnGetScriptRunning);
            _scene.EventManager.OnStartScript             += new EventManager.StartScript(EventManager_OnStartScript);
            _scene.EventManager.OnStopScript              += new EventManager.StopScript(EventManager_OnStopScript);
            _scene.EventManager.OnCompileScript           += new EventManager.CompileScript(EventManager_OnCompileScript);
            _scene.EventManager.OnGroupCrossedToNewParcel += new EventManager.GroupCrossedToNewParcelDelegate(EventManager_OnGroupCrossedToNewParcel);
            _scene.EventManager.OnSOGOwnerGroupChanged    += new EventManager.SOGOwnerGroupChangedDelegate(EventManager_OnSOGOwnerGroupChanged);
            _scene.EventManager.OnCrossedAvatarReady      += OnCrossedAvatarReady;
            _scene.EventManager.OnGroupBeginInTransit     += EventManager_OnGroupBeginInTransit;
            _scene.EventManager.OnGroupEndInTransit       += EventManager_OnGroupEndInTransit;

            _masterScheduler.Start();

            _scene.StackModuleInterface <IScriptModule>(this);

            Phlox.Util.Preloader.Preload();
        }
Ejemplo n.º 6
0
        //
        //Dumps an error message on the debug console.
        //

        internal void MODShoutError(string message) 
        {
            if (message.Length > 1023)
                message = message.Substring(0, 1023);

            World.SimChat(Utils.StringToBytes(message),
                          ChatTypeEnum.Shout, ScriptBaseClass.DEBUG_CHANNEL, m_host.ParentGroup.RootPart.AbsolutePosition, m_host.Name, m_host.UUID, true);

            IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
            wComm.DeliverMessage(ChatTypeEnum.Shout, ScriptBaseClass.DEBUG_CHANNEL, m_host.Name, m_host.UUID, message);
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Unregister a specific script from facilities (and all its pending commands)
        /// </summary>
        /// <param name="localID"></param>
        /// <param name="itemID"></param>
        public static void UnregisterScriptFacilities(IScriptEngine engine, uint localID, UUID itemID, bool resetScript)
        {
//            m_log.DebugFormat("[ASYNC COMMAND MANAGER]: Removing facilities for script {0}", itemID);

            staticLock.AcquireReaderLock(-1);
            try
            {
                // Remove dataserver events
                m_Dataserver[engine].RemoveEvents(localID, itemID);

                if (resetScript)
                {
                    // Remove from: Timers
                    m_Timer[engine].UnSetTimerEvents(localID, itemID);

                    // Remove from: HttpRequest
                    IHttpRequestModule iHttpReq = engine.World.RequestModuleInterface <IHttpRequestModule>();
                    if (iHttpReq != null)
                    {
                        iHttpReq.StopHttpRequestsForScript(itemID);
                    }
                }

                IWorldComm comms = engine.World.RequestModuleInterface <IWorldComm>();
                if (comms != null)
                {
                    comms.DeleteListener(itemID);
                }

                IXMLRPC xmlrpc = engine.World.RequestModuleInterface <IXMLRPC>();
                if (xmlrpc != null)
                {
                    xmlrpc.DeleteChannels(itemID);
                    xmlrpc.CancelSRDRequests(itemID);
                }

                // Remove Sensors
                m_SensorRepeat[engine].UnSetSenseRepeaterEvents(localID, itemID);
            }
            finally
            {
                staticLock.ReleaseReaderLock();
            }
        }
Ejemplo n.º 8
0
        //
        //Dumps an error message on the debug console.
        //

        internal void modShoutError(string message)
        {
            if (message.Length > 1023)
            {
                message = message.Substring(0, 1023);
            }

            IChatModule chatModule = World.RequestModuleInterface <IChatModule>();

            if (chatModule != null)
            {
                chatModule.SimChat(message, ChatTypeEnum.Shout, ScriptBaseClass.DEBUG_CHANNEL,
                                   m_host.ParentEntity.RootChild.AbsolutePosition, m_host.Name, m_host.UUID, true, World);
            }

            IWorldComm wComm = World.RequestModuleInterface <IWorldComm>();

            wComm.DeliverMessage(ChatTypeEnum.Shout, ScriptBaseClass.DEBUG_CHANNEL, m_host.Name, m_host.UUID, message);
        }
Ejemplo n.º 9
0
        /// <summary>
        /// This sets the estateID for the region if the estate password is set right
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void OnChatFromClient(object sender, OSChatMessage e)
        {
            //For Estate Password
            EstateChange Change = null;

            if (ChannelDirectory.TryGetValue(e.Sender.AgentId, out Change))
            {
                //Check whether the channel is right
                if (Change.Channel == e.Channel)
                {
                    ((IClientAPI)sender).OnChatFromClient -= OnChatFromClient;
                    ChannelDirectory.Remove(e.Sender.AgentId);
                    IWorldComm comm = ((Scene)((IClientAPI)sender).Scene).RequestModuleInterface <IWorldComm>();
                    //Unblock the channel now that we have the password
                    comm.RemoveBlockedChannel(Change.Channel);

                    string Password = Util.Md5Hash(e.Message);
                    //Try to switch estates
                    bool changed = DataManager.DataManager.RequestPlugin <IEstateConnector>().LinkRegion(((Scene)((IClientAPI)sender).Scene).RegionInfo.RegionID, (int)Change.EstateID, Password);
                    if (!changed)
                    {
                        //Revert it, it didn't work
                        ((Scene)((IClientAPI)sender).Scene).RegionInfo.EstateSettings.EstateID = Change.OldEstateID;
                        ((IClientAPI)sender).SendAgentAlertMessage("Unable to connect to the given estate.", false);
                    }
                    else
                    {
                        ((Scene)((IClientAPI)sender).Scene).RegionInfo.EstateSettings.EstateID = Change.EstateID;
                        ((Scene)((IClientAPI)sender).Scene).RegionInfo.EstateSettings.Save();
                        ((IClientAPI)sender).SendAgentAlertMessage("Estate Updated.", false);
                    }
                    //Tell the clients to update all references to the new settings
                    foreach (IScenePresence sp in ((IClientAPI)sender).Scene.GetScenePresences())
                    {
                        HandleRegionInfoRequest(sp.ControllingClient, ((Scene)((IClientAPI)sender).Scene));
                    }
                }
            }
        }
Ejemplo n.º 10
0
        /// <summary>
        /// Remove a specific script (and all its pending commands)
        /// </summary>
        /// <param name="localID"></param>
        /// <param name="itemID"></param>
        public static void RemoveScript(IScriptEngine engine, uint localID, UUID itemID)
        {
            // Remove a specific script
            //            m_log.DebugFormat("[ASYNC COMMAND MANAGER]: Removing facilities for script {0}", itemID);

            lock (staticLock)
            {
                // Remove dataserver events
                m_Dataserver[engine].RemoveEvents(localID, itemID);

                // Remove from: Timers
                m_Timer[engine].UnSetTimerEvents(localID, itemID);

                if (engine.World != null)
                {
                    // Remove from: HttpRequest
                    IHttpRequestModule iHttpReq = engine.World.RequestModuleInterface <IHttpRequestModule>();
                    if (iHttpReq != null)
                    {
                        iHttpReq.StopHttpRequest(localID, itemID);
                    }

                    IWorldComm comms = engine.World.RequestModuleInterface <IWorldComm>();
                    if (comms != null)
                    {
                        comms.DeleteListener(itemID);
                    }

                    IXMLRPC xmlrpc = engine.World.RequestModuleInterface <IXMLRPC>();
                    if (xmlrpc != null)
                    {
                        xmlrpc.DeleteChannels(itemID);
                        xmlrpc.CancelSRDRequests(itemID);
                    }
                }
                // Remove Sensors
                m_SensorRepeat[engine].UnSetSenseRepeaterEvents(localID, itemID);
            }
        }
Ejemplo n.º 11
0
        protected override byte[] ProcessRequest(string path, Stream requestData, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
        {
            try
            {
                String requestBody = new StreamReader(requestData).ReadToEnd();

                BasicChatData data = JsonConvert.DeserializeObject <BasicChatData>(requestBody);

                byte[] binText = Util.StringToBytesNoTerm(data.Message, 1023);
                m_world.SimChat(binText, ChatTypeEnum.Region, data.Channel, new Vector3(128, 128, 20), data.Name, UUID.Random(), data.Agent);
                m_world.SimChatBroadcast(binText, ChatTypeEnum.Region, data.Channel, new Vector3(128, 128, 20), data.Name, UUID.Random(), data.Agent);

                IWorldComm wComm = m_world.RequestModuleInterface <IWorldComm>();
                if (wComm != null)
                {
                    wComm.DeliverMessage(ChatTypeEnum.Region, data.Channel, data.Name, UUID.Random(), Util.UTF8.GetString(binText));
                }

                return(Encoding.UTF8.GetBytes("ok"));
            }catch (Exception error)
            {
                return(Encoding.UTF8.GetBytes("error: " + error.Message));
            }
        }
Ejemplo n.º 12
0
        public void Initialize(IScriptModulePlugin ScriptEngine, SceneObjectPart host, uint localID, UUID itemID, ScriptProtectionModule module)
        {
            m_ScriptEngine = ScriptEngine;
            m_host = host;
            m_localID = localID;
            m_itemID = itemID;
            ScriptProtection = module;

            m_ScriptDelayFactor =
                m_ScriptEngine.Config.GetFloat("ScriptDelayFactor", 1.0f);
            m_ScriptDistanceFactor =
                m_ScriptEngine.Config.GetFloat("ScriptDistanceLimitFactor", 1.0f);
            m_MinTimerInterval =
                m_ScriptEngine.Config.GetFloat("MinTimerInterval", 0.5f);
            m_automaticLinkPermission =
                m_ScriptEngine.Config.GetBoolean("AutomaticLinkPermission", false);
            m_notecardLineReadCharsMax =
                m_ScriptEngine.Config.GetInt("NotecardLineReadCharsMax", 255);
            if (m_notecardLineReadCharsMax > 65535)
                m_notecardLineReadCharsMax = 65535;

            m_TransferModule =
                    World.RequestModuleInterface<IMessageTransferModule>();
            m_UrlModule = World.RequestModuleInterface<IUrlModule>();
            m_comms = World.RequestModuleInterface<IWorldComm>();
        }
Ejemplo n.º 13
0
 /// <summary>
 /// Sets up references to modules required by the scene
 /// </summary>
 public void SetModuleInterfaces()
 {
     m_xmlrpcModule = RequestModuleInterface<IXMLRPC>();
     m_worldCommModule = RequestModuleInterface<IWorldComm>();
     XferManager = RequestModuleInterface<IXfer>();
     m_AvatarFactory = RequestModuleInterface<IAvatarFactoryModule>();
     AttachmentsModule = RequestModuleInterface<IAttachmentsModule>();
     m_serialiser = RequestModuleInterface<IRegionSerialiserModule>();
     m_dialogModule = RequestModuleInterface<IDialogModule>();
     m_capsModule = RequestModuleInterface<ICapabilitiesModule>();
     EntityTransferModule = RequestModuleInterface<IEntityTransferModule>();
     m_groupsModule = RequestModuleInterface<IGroupsModule>();
     AgentTransactionsModule = RequestModuleInterface<IAgentAssetTransactions>();
     UserManagementModule = RequestModuleInterface<IUserManagement>();
 }
Ejemplo n.º 14
0
        /// <summary>
        /// The god has requested that we update something in the region configs
        /// </summary>
        /// <param name="client"></param>
        /// <param name="BillableFactor"></param>
        /// <param name="PricePerMeter"></param>
        /// <param name="EstateID"></param>
        /// <param name="RegionFlags"></param>
        /// <param name="SimName"></param>
        /// <param name="RedirectX"></param>
        /// <param name="RedirectY"></param>
        public void GodUpdateRegionInfoUpdate(IClientAPI client, float BillableFactor, int PricePerMeter, ulong EstateID, ulong RegionFlags, byte[] SimName, int RedirectX, int RedirectY)
        {
            //Check god perms
            if (!((Scene)client.Scene).Permissions.IsGod(client.AgentId))
            {
                return;
            }

            //Update their current region with new information
            string oldRegionName = client.Scene.RegionInfo.RegionName;

            client.Scene.RegionInfo.RegionName = Utils.BytesToString(SimName);

            //Set the region loc X and Y
            if (RedirectX != 0)
            {
                client.Scene.RegionInfo.RegionLocX = RedirectX * (int)Constants.RegionSize;
            }
            if (RedirectY != 0)
            {
                client.Scene.RegionInfo.RegionLocY = RedirectY * (int)Constants.RegionSize;
            }

            //Update the estate ID
            if (client.Scene.RegionInfo.EstateSettings.EstateID != EstateID)
            {
                //If they are changing estates, we have to ask them for the password to the estate, so send them an llTextBox
                string        Password = "";
                IWorldComm    comm     = client.Scene.RequestModuleInterface <IWorldComm>();
                IDialogModule dialog   = client.Scene.RequestModuleInterface <IDialogModule>();
                //If the comms module is not null, we send the user a text box on a random channel so that they cannot be tapped into
                if (comm != null && dialog != null)
                {
                    int Channel = new Random().Next(1000, 100000);
                    //Block the channel so NOONE can access it until the question is answered
                    comm.AddBlockedChannel(Channel);
                    ChannelDirectory.Add(client.AgentId, new EstateChange()
                    {
                        Channel = Channel, EstateID = (uint)EstateID, OldEstateID = ((Scene)client.Scene).RegionInfo.EstateSettings.EstateID
                    });
                    //Set the ID temperarily, if it doesn't work, we will revert it later
                    ((Scene)client.Scene).RegionInfo.EstateSettings.EstateID = (uint)EstateID;
                    client.OnChatFromClient += OnChatFromClient;
                    dialog.SendTextBoxToUser(client.AgentId, "Please type the password for the estate you wish to join. (Note: this channel is secured and will not be able to be listened in on)", Channel, "Server", UUID.Zero, UUID.Zero);
                }
                else
                {
                    bool changed = DataManager.DataManager.RequestPlugin <IEstateConnector>().LinkRegion(((Scene)client.Scene).RegionInfo.RegionID, (int)EstateID, Util.Md5Hash(Password));
                    if (!changed)
                    {
                        client.SendAgentAlertMessage("Unable to connect to the given estate.", false);
                    }
                    else
                    {
                        client.Scene.RegionInfo.EstateSettings.EstateID = (uint)EstateID;
                        client.Scene.RegionInfo.EstateSettings.Save();
                    }
                }
            }

            //Set the other settings
            client.Scene.RegionInfo.EstateSettings.BillableFactor = BillableFactor;
            client.Scene.RegionInfo.EstateSettings.PricePerMeter  = PricePerMeter;
            client.Scene.RegionInfo.EstateSettings.SetFromFlags(RegionFlags);

            client.Scene.RegionInfo.RegionSettings.AllowDamage    = ((RegionFlags & (ulong)OpenMetaverse.RegionFlags.AllowDamage) == (ulong)OpenMetaverse.RegionFlags.AllowDamage);
            client.Scene.RegionInfo.RegionSettings.FixedSun       = ((RegionFlags & (ulong)OpenMetaverse.RegionFlags.SunFixed) == (ulong)OpenMetaverse.RegionFlags.SunFixed);
            client.Scene.RegionInfo.RegionSettings.BlockTerraform = ((RegionFlags & (ulong)OpenMetaverse.RegionFlags.BlockTerraform) == (ulong)OpenMetaverse.RegionFlags.BlockTerraform);
            client.Scene.RegionInfo.RegionSettings.Sandbox        = ((RegionFlags & (ulong)OpenMetaverse.RegionFlags.Sandbox) == (ulong)OpenMetaverse.RegionFlags.Sandbox);

            //Update skipping scripts/physics/collisions
            IEstateModule mod = client.Scene.RequestModuleInterface <IEstateModule>();

            if (mod != null)
            {
                mod.SetSceneCoreDebug(((RegionFlags & (ulong)OpenMetaverse.RegionFlags.SkipScripts) == (ulong)OpenMetaverse.RegionFlags.SkipScripts),
                                      ((RegionFlags & (ulong)OpenMetaverse.RegionFlags.SkipCollisions) == (ulong)OpenMetaverse.RegionFlags.SkipCollisions),
                                      ((RegionFlags & (ulong)OpenMetaverse.RegionFlags.SkipPhysics) == (ulong)OpenMetaverse.RegionFlags.SkipPhysics));
            }

            //Save the changes
            client.Scene.RegionInfo.EstateSettings.Save();
            client.Scene.RegionInfo.RegionSettings.Save();

            //Save the changes
            IConfig config = m_config.Configs["RegionStartup"];

            if (config != null)
            {
                //TERRIBLE! Needs to be modular, but we can't access the module from a scene module!
                if (config.GetString("Default") == "RegionLoaderDataBaseSystem")
                {
                    SaveChangesDatabase(client.Scene.RegionInfo);
                }
                else
                {
                    SaveChangesFile(oldRegionName, client.Scene.RegionInfo);
                }
            }
            else
            {
                SaveChangesFile(oldRegionName, client.Scene.RegionInfo);
            }


            //Tell the clients to update all references to the new settings
            foreach (IScenePresence sp in client.Scene.GetScenePresences())
            {
                HandleRegionInfoRequest(sp.ControllingClient, ((Scene)client.Scene));
            }

            //Update the grid server as well
            IGridRegisterModule gridRegisterModule = client.Scene.RequestModuleInterface <IGridRegisterModule>();

            if (gridRegisterModule != null)
            {
                gridRegisterModule.UpdateGridRegion(client.Scene);
            }
        }
Ejemplo n.º 15
0
 public Listener(AsyncCommandManager CmdManager)
 {
     m_CmdManager = CmdManager;
     m_commsPlugin = m_CmdManager.m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
 }
Ejemplo n.º 16
0
 /// <summary>
 /// Sets up references to modules required by the scene
 /// </summary>
 public void SetModuleInterfaces()
 {
     m_xmlrpcModule = RequestModuleInterface<IXMLRPC>();
     m_worldCommModule = RequestModuleInterface<IWorldComm>();
     XferManager = RequestModuleInterface<IXfer>();
     m_AvatarFactory = RequestModuleInterface<IAvatarFactory>();
     m_serialiser = RequestModuleInterface<IRegionSerialiserModule>();
     m_interregionCommsOut = RequestModuleInterface<IInterregionCommsOut>();
     m_interregionCommsIn = RequestModuleInterface<IInterregionCommsIn>();
     m_dialogModule = RequestModuleInterface<IDialogModule>();
     m_capsModule = RequestModuleInterface<ICapabilitiesModule>();
     m_teleportModule = RequestModuleInterface<ITeleportModule>();
 }
Ejemplo n.º 17
0
 public void Initialize(ScriptEngine ScriptEngine, Scene scene)
 {
     m_ScriptEngine = ScriptEngine;
     comms = scene.RequestModuleInterface<IWorldComm>();
 }
Ejemplo n.º 18
0
 /// <summary>
 /// Sets up references to modules required by the scene
 /// </summary>
 public void SetModuleInterfaces()
 {
     m_xmlrpcModule = RequestModuleInterface<IXMLRPC>();
     m_worldCommModule = RequestModuleInterface<IWorldComm>();
     XferManager = RequestModuleInterface<IXfer>();
     m_AvatarFactory = RequestModuleInterface<IAvatarFactory>();
     AttachmentsModule = RequestModuleInterface<IAttachmentsModule>();
     m_serialiser = RequestModuleInterface<IRegionSerialiserModule>();
     m_dialogModule = RequestModuleInterface<IDialogModule>();
     m_capsModule = RequestModuleInterface<ICapabilitiesModule>();
     m_teleportModule = RequestModuleInterface<IEntityTransferModule>();
 }
Ejemplo n.º 19
0
        public void Initialize(IScriptModulePlugin ScriptEngine, ISceneChildEntity host, uint localID, UUID itemID,
                               ScriptProtectionModule module)
        {
            m_ScriptEngine = ScriptEngine;
            m_host = host;
            m_localID = localID;
            m_itemID = itemID;
            ScriptProtection = module;

            m_ScriptDelayFactor =
                m_ScriptEngine.Config.GetFloat("ScriptDelayFactor", 1.0f);
            m_ScriptDistanceFactor =
                m_ScriptEngine.Config.GetFloat("ScriptDistanceLimitFactor", 1.0f);
            m_MinTimerInterval =
                m_ScriptEngine.Config.GetFloat("MinTimerInterval", 0.5f);
            m_automaticLinkPermission =
                m_ScriptEngine.Config.GetBoolean("AutomaticLinkPermission", false);
            m_allowOpenSimParams =
                m_ScriptEngine.Config.GetBoolean("AllowOpenSimParamsInLLFunctions", false);
            m_notecardLineReadCharsMax =
                m_ScriptEngine.Config.GetInt("NotecardLineReadCharsMax", 255);
            if (m_notecardLineReadCharsMax > 65535)
                m_notecardLineReadCharsMax = 65535;

            m_TransferModule =
                World.RequestModuleInterface<IMessageTransferModule>();
            m_UrlModule = World.RequestModuleInterface<IUrlModule>();
            m_comms = World.RequestModuleInterface<IWorldComm>();

            m_sleepMsOnEmail = EMAIL_PAUSE_TIME * 1000;
        }
Ejemplo n.º 20
0
        /// <summary>
        /// Sets up references to modules required by the scene
        /// </summary>
        public void SetModuleInterfaces()
        {
            m_xmlrpcModule = RequestModuleInterface<IXMLRPC>();
            m_worldCommModule = RequestModuleInterface<IWorldComm>();
            XferManager = RequestModuleInterface<IXfer>();
            m_AvatarFactory = RequestModuleInterface<IAvatarFactory>();
            AttachmentsModule = RequestModuleInterface<IAttachmentsModule>();
            m_serialiser = RequestModuleInterface<IRegionSerialiserModule>();
            m_dialogModule = RequestModuleInterface<IDialogModule>();
            m_capsModule = RequestModuleInterface<ICapabilitiesModule>();
            m_teleportModule = RequestModuleInterface<IEntityTransferModule>();

            // Shoving this in here for now, because we have the needed
            // interfaces at this point
            //
            // TODO: Find a better place for this
            //
            while (m_regInfo.EstateSettings.EstateOwner == UUID.Zero && MainConsole.Instance != null)
            {
                MainConsole.Instance.Output("The current estate " + m_regInfo.EstateSettings.EstateName + " has no owner set.");
                List<char> excluded = new List<char>(new char[1] { ' ' });
                string first = MainConsole.Instance.CmdPrompt("Estate owner first name", "Test", excluded);
                string last = MainConsole.Instance.CmdPrompt("Estate owner last name", "User", excluded);

                UserAccount account = UserAccountService.GetUserAccount(m_regInfo.ScopeID, first, last);

                if (account == null)
                {
                    // Create a new account
                    account = new UserAccount(m_regInfo.ScopeID, first, last, String.Empty);
                    if (account.ServiceURLs == null || (account.ServiceURLs != null && account.ServiceURLs.Count == 0))
                    {
                        account.ServiceURLs = new Dictionary<string, object>();
                        account.ServiceURLs["HomeURI"] = string.Empty;
                        account.ServiceURLs["GatekeeperURI"] = string.Empty;
                        account.ServiceURLs["InventoryServerURI"] = string.Empty;
                        account.ServiceURLs["AssetServerURI"] = string.Empty;
                    }

                    if (UserAccountService.StoreUserAccount(account))
                    {
                        string password = MainConsole.Instance.PasswdPrompt("Password");
                        string email = MainConsole.Instance.CmdPrompt("Email", "");

                        account.Email = email;
                        UserAccountService.StoreUserAccount(account);

                        bool success = false;
                        success = AuthenticationService.SetPassword(account.PrincipalID, password);
                        if (!success)
                            m_log.WarnFormat("[USER ACCOUNT SERVICE]: Unable to set password for account {0} {1}.",
                               first, last);

                        GridRegion home = null;
                        if (GridService != null)
                        {
                            List<GridRegion> defaultRegions = GridService.GetDefaultRegions(UUID.Zero);
                            if (defaultRegions != null && defaultRegions.Count >= 1)
                                home = defaultRegions[0];

                            if (GridUserService != null && home != null)
                                GridUserService.SetHome(account.PrincipalID.ToString(), home.RegionID, new Vector3(128, 128, 0), new Vector3(0, 1, 0));
                            else
                                m_log.WarnFormat("[USER ACCOUNT SERVICE]: Unable to set home for account {0} {1}.",
                                   first, last);

                        }
                        else
                            m_log.WarnFormat("[USER ACCOUNT SERVICE]: Unable to retrieve home region for account {0} {1}.",
                               first, last);

                        if (InventoryService != null)
                            success = InventoryService.CreateUserInventory(account.PrincipalID);
                        if (!success)
                            m_log.WarnFormat("[USER ACCOUNT SERVICE]: Unable to create inventory for account {0} {1}.",
                               first, last);


                        m_log.InfoFormat("[USER ACCOUNT SERVICE]: Account {0} {1} created successfully", first, last);

                        m_regInfo.EstateSettings.EstateOwner = account.PrincipalID;
                        m_regInfo.EstateSettings.Save();
                    }
                    else
                        m_log.ErrorFormat("[SCENE]: Unable to store account. If this simulator is connected to a grid, you must create the estate owner account first.");
                }
                else
                {
                    m_regInfo.EstateSettings.EstateOwner = account.PrincipalID;
                    m_regInfo.EstateSettings.Save();
                }
            }
        }
Ejemplo n.º 21
0
 public Listener(AsyncCommandManager CmdManager)
 {
     m_CmdManager  = CmdManager;
     m_commsPlugin = m_CmdManager.m_ScriptEngine.World.RequestModuleInterface <IWorldComm>();
 }
Ejemplo n.º 22
0
        public Object[] GetSerializationData(UUID itemID)
        {
            IWorldComm comms = m_CmdManager.m_ScriptEngine.World.RequestModuleInterface <IWorldComm>();

            return(comms.GetSerializationData(itemID));
        }