Exemplo n.º 1
1
        public void Initialize(ScriptEngine ScriptEngine, SceneObjectPart host, uint localID, UUID itemID, ScriptProtectionModule module)
        {
            m_ScriptEngine = ScriptEngine;
            m_host = host;
            m_localID = localID;
            m_itemID = itemID;
            ScriptProtection = module;

            m_comms = World.RequestModuleInterface<IScriptModuleComms>();
        }
Exemplo n.º 2
0
        public override void RegionLoaded(Scene scene)
        {
            base.World = scene;

            try
            {
                IScriptModuleComms m_scriptModule = base.World.RequestModuleInterface <IScriptModuleComms>();
                m_scriptModule.RegisterScriptInvocation(this, "osEasyDialog");
            }
            catch (Exception e)
            {
                base.Logger.WarnFormat("[" + Name + "]: script method registration failed; {0}", e.Message);
            }

            m_dialogModule = base.World.RequestModuleInterface <IDialogModule>();
            m_scriptEngine = base.World.RequestModuleInterface <IScriptModule>();

            base.World.EventManager.OnChatFromClient += onChat;
            base.World.EventManager.OnScriptReset    += onScriptReset;
            base.World.EventManager.OnRemoveScript   += onScriptRemove;

            m_timer           = new Timer();
            m_timer.Interval  = 60000;
            m_timer.AutoReset = true;
            m_timer.Elapsed  += cleanup;
            m_timer.Start();
        }
Exemplo n.º 3
0
        public void Initialize(
            IScriptEngine scriptEngine, SceneObjectPart host, TaskInventoryItem item)
        {
            m_ScriptEngine = scriptEngine;
            m_host         = host;
            m_item         = item;


            m_osslconfig = m_ScriptEngine.ConfigSource.Configs["OSSL"];
            if (m_osslconfig == null)
            {
                m_osslconfig = m_ScriptEngine.Config;
            }

            if (m_osslconfig.GetBoolean("AllowMODFunctions", false))
            {
                m_MODFunctionsEnabled = true;
            }

            m_comms = m_ScriptEngine.World.RequestModuleInterface <IScriptModuleComms>();
            if (m_comms == null)
            {
                m_MODFunctionsEnabled = false;
            }
        }
Exemplo n.º 4
0
        public override void RegionLoaded(Scene scene)
        {
            base.World = scene;
            base.World.EventManager.OnChatFromClient += onChat;
            base.World.EventManager.OnChatFromWorld  += onChat;

            base.World.EventManager.OnNewPresence    += scriptevent_OnNewPresence;
            base.World.EventManager.OnRemovePresence += scriptevent_OnRemovePresence;

            try
            {
                IScriptModuleComms m_scriptModule = base.World.RequestModuleInterface <IScriptModuleComms>();
                m_scriptModule.RegisterScriptInvocation(this, "osSendToDiscord");
            }
            catch (Exception e)
            {
                base.Logger.WarnFormat("[" + Name + "]: script method registration failed; {0}", e.Message);
            }

            WebHook webhook = new WebHook(m_discordWebHookURL);

            webhook.Name    = base.World.Name;
            webhook.Message = "The region started successfully.";
            webhook.sendAsync();
        }
Exemplo n.º 5
0
        public override void RegionLoaded(Scene scene)
        {
            base.World = scene;

            if (base.World != null)
            {
                try
                {
                    m_scriptModule = base.World.RequestModuleInterface <IScriptModuleComms>();

                    m_scriptModule.RegisterScriptInvocation(this, "osGetSearchableObjectList");
                    m_scriptModule.RegisterScriptInvocation(this, "osGetSearchableObjectPartList");
                }
                catch (Exception e)
                {
                    base.Logger.WarnFormat("[" + Name + "]: Script method registration failed; {0}", e.Message);
                }

                base.World.EventManager.OnSceneObjectLoaded      += onSceneObjectLoaded;
                base.World.EventManager.OnSceneObjectPartCopy    += onSceneObjectPartCopy;
                base.World.EventManager.OnSceneObjectPartUpdated += onSceneObjectPartUpdated;
                base.World.EventManager.OnIncomingSceneObject    += onIncomingSceneObject;
            }
            else
            {
                base.Logger.Warn("[" + Name + "]: scene == null");
            }
        }
Exemplo n.º 6
0
        public void RegionLoaded(Scene scene)
        {
            if (m_enabled)
            {
                m_scene = scene;
                m_comms = m_scene.RequestModuleInterface <IScriptModuleComms>();
                if (m_comms == null)
                {
                    m_log.WarnFormat("[ModInvoke] ScriptModuleComms interface not defined");
                    m_enabled = false;

                    return;
                }

                m_comms.RegisterScriptInvocation(this, "ModTest0");
                m_comms.RegisterScriptInvocation(this, "ModTest1");
                m_comms.RegisterScriptInvocation(this, "ModTest2");
                m_comms.RegisterScriptInvocation(this, "ModTest3");
                m_comms.RegisterScriptInvocation(this, "ModTest4");
                m_comms.RegisterScriptInvocation(this, "ModTest5");
                m_comms.RegisterScriptInvocation(this, "ModTest6");
                m_comms.RegisterScriptInvocation(this, "ModTest7");
                m_comms.RegisterScriptInvocation(this, "ModTest8");

                // Register some constants as well
                m_comms.RegisterConstant("ModConstantInt1", 25);
                m_comms.RegisterConstant("ModConstantFloat1", 25.000f);
                m_comms.RegisterConstant("ModConstantString1", "abcdefg");
            }
        }
Exemplo n.º 7
0
        // -----------------------------------------------------------------
        /// <summary>
        /// Called when all modules have been added for a region. This is
        /// where we hook up events
        /// </summary>
        // -----------------------------------------------------------------
        public void RegionLoaded(Scene scene)
        {
            if (m_enabled)
            {
                m_scene = scene;
                m_comms = m_scene.RequestModuleInterface <IScriptModuleComms>();
                if (m_comms == null)
                {
                    m_log.ErrorFormat("[JsonStoreScripts]: ScriptModuleComms interface not defined");
                    m_enabled = false;
                    return;
                }

                m_store = m_scene.RequestModuleInterface <IJsonStoreModule>();
                if (m_store == null)
                {
                    m_log.ErrorFormat("[JsonStoreScripts]: JsonModule interface not defined");
                    m_enabled = false;
                    return;
                }

                try
                {
                    m_comms.RegisterScriptInvocations(this);
                    m_comms.RegisterConstants(this);
                }
                catch (Exception e)
                {
                    // See http://opensimulator.org/mantis/view.php?id=5971 for more information
                    m_log.WarnFormat("[JsonStoreScripts]: script method registration failed; {0}", e.Message);
                    m_enabled = false;
                }
            }
        }
Exemplo n.º 8
0
 public void RegionLoaded(Scene scene)
 {
     m_ScriptComms = scene.RequestModuleInterface <IScriptModuleComms>();
     if (m_ScriptComms != null)
     {
         m_ScriptComms.OnScriptCommand += OnScriptCommand;
     }
 }
Exemplo n.º 9
0
        RayTracer currentModel;                        //Current ray tracer model

        public RayTracerRequestHandler(IScriptModuleComms _m_commsMod, Scene _m_scene)
        {
            isBusy = false;
            currentModel = new RayTracer();

            m_commsMod = _m_commsMod;
            m_scene = _m_scene;
        }//constructure
Exemplo n.º 10
0
        private void RegisterScriptFunctions()
        {
            IScriptModuleComms comms = m_scene.RequestModuleInterface <IScriptModuleComms>();

            if (comms != null)
            {
                comms.RegisterScriptInvocation(this, "birdsGetStats");
            }
        }
Exemplo n.º 11
0
        public OpenSimDispatcher(WaterWarsController controller)
        {
            m_controller = controller;

            m_controller.EventManager.OnGameAssetBuildStarted += CreateGameAssetView;

            // FIXME: If we use this again, we'll need to get one per scene since IScriptModuleComms is not shared
            m_scriptModuleComms = m_controller.Scenes[0].RequestModuleInterface<IScriptModuleComms>();
            //            m_scriptModuleComms.OnScriptCommand += ProcessScriptCommand;
        }
Exemplo n.º 12
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_comms = World.RequestModuleInterface <IScriptModuleComms>();
        }
Exemplo n.º 13
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_comms = World.RequestModuleInterface<IScriptModuleComms>();
        }
Exemplo n.º 14
0
        public OpenSimDispatcher(WaterWarsController controller)
        {
            m_controller = controller;

            m_controller.EventManager.OnGameAssetBuildStarted += CreateGameAssetView;

            // FIXME: If we use this again, we'll need to get one per scene since IScriptModuleComms is not shared
            m_scriptModuleComms = m_controller.Scenes[0].RequestModuleInterface <IScriptModuleComms>();
//            m_scriptModuleComms.OnScriptCommand += ProcessScriptCommand;
        }
Exemplo n.º 15
0
 public void Clear()
 {
     m_astRoot.kids = null;
     m_astRoot.yylx = null;
     m_astRoot.yyps = null;
     m_astRoot      = null;
     m_positionMap  = null;
     m_warnings.Clear();
     m_comms = null;
 }
Exemplo n.º 16
0
        // -----------------------------------------------------------------
        /// <summary>
        /// Called when all modules have been added for a region. This is
        /// where we hook up events
        /// </summary>
        // -----------------------------------------------------------------
        public void RegionLoaded(Scene scene)
        {
            if (m_enabled)
            {
                m_scene = scene;
                m_comms = m_scene.RequestModuleInterface <IScriptModuleComms>();
                if (m_comms == null)
                {
                    m_log.ErrorFormat("[JsonStoreScripts] ScriptModuleComms interface not defined");
                    m_enabled = false;
                    return;
                }

                m_store = m_scene.RequestModuleInterface <IJsonStoreModule>();
                if (m_store == null)
                {
                    m_log.ErrorFormat("[JsonStoreScripts] JsonModule interface not defined");
                    m_enabled = false;
                    return;
                }

                try
                {
                    m_comms.RegisterScriptInvocation(this, "JsonCreateStore");
                    m_comms.RegisterScriptInvocation(this, "JsonDestroyStore");

                    m_comms.RegisterScriptInvocation(this, "JsonReadNotecard");
                    m_comms.RegisterScriptInvocation(this, "JsonWriteNotecard");

                    m_comms.RegisterScriptInvocation(this, "JsonTestPath");
                    m_comms.RegisterScriptInvocation(this, "JsonTestPathJson");

                    m_comms.RegisterScriptInvocation(this, "JsonGetValue");
                    m_comms.RegisterScriptInvocation(this, "JsonGetValueJson");

                    m_comms.RegisterScriptInvocation(this, "JsonTakeValue");
                    m_comms.RegisterScriptInvocation(this, "JsonTakeValueJson");

                    m_comms.RegisterScriptInvocation(this, "JsonReadValue");
                    m_comms.RegisterScriptInvocation(this, "JsonReadValueJson");

                    m_comms.RegisterScriptInvocation(this, "JsonSetValue");
                    m_comms.RegisterScriptInvocation(this, "JsonSetValueJson");

                    m_comms.RegisterScriptInvocation(this, "JsonRemoveValue");
                }
                catch (Exception e)
                {
                    // See http://opensimulator.org/mantis/view.php?id=5971 for more information
                    m_log.WarnFormat("[JsonStroreScripts] script method registration failed; {0}", e.Message);
                    m_enabled = false;
                }
            }
        }
Exemplo n.º 17
0
        public void Initialize(IScriptEngine ScriptEngine, SceneObjectPart host, TaskInventoryItem item)
        {
            m_ScriptEngine = ScriptEngine;
            m_host = host;

            if (m_ScriptEngine.Config.GetBoolean("AllowLightShareFunctions", false))
                m_LSFunctionsEnabled = true;

            m_comms = m_ScriptEngine.World.RequestModuleInterface<IScriptModuleComms>();
            if (m_comms == null)
                m_LSFunctionsEnabled = false;
        }
Exemplo n.º 18
0
        public override void RegionLoaded(Scene scene)
        {
            base.Logger.Info("[" + Name + "]: Load region " + scene.Name);

            base.World = scene;

            if (m_storageTyp == "REGIONEXTRAS")
            {
                m_storage = new RegionExtras(base.World, m_config);
            }

            if (m_storageTyp == "FILESYSTEM")
            {
                m_storage = new FileSystem(base.World, m_config);
            }

            if (m_storageTyp == "MYSQL")
            {
                m_storage = new MySQL(base.World, m_config);
            }

            if (m_storageTyp == "REDIS")
            {
                m_storage = new Redis(base.World, m_config);
            }

            if (m_storageTyp == "MEMORY")
            {
                m_storage = new Memory();
            }

            if (m_storage == null)
            {
                m_storage = new Memory();
            }

            base.Logger.Info("[" + Name + "] Using '" + m_storageTyp + "' as Storage.");

            m_scriptModule = base.World.RequestModuleInterface <IScriptModuleComms>();
            if (m_scriptModule != null)
            {
                m_scriptModule.RegisterScriptInvocation(this, "osGetDataValue");
                m_scriptModule.RegisterScriptInvocation(this, "osSetDataValue");
                m_scriptModule.RegisterScriptInvocation(this, "osDeleteDataValue");
                m_scriptModule.RegisterScriptInvocation(this, "osCheckDataValue");

                m_scriptModule.RegisterScriptInvocation(this, "osGetPrivateDataValue");
                m_scriptModule.RegisterScriptInvocation(this, "osSetPrivateDataValue");
                m_scriptModule.RegisterScriptInvocation(this, "osDeletePrivateDataValue");
                m_scriptModule.RegisterScriptInvocation(this, "osCheckPrivateDataValue");
            }
        }
Exemplo n.º 19
0
        public void Initialize(IScriptEngine ScriptEngine, SceneObjectPart host, uint localID, UUID itemID)
        {
            m_ScriptEngine = ScriptEngine;
            m_host = host;
            m_localID = localID;
            m_itemID = itemID;

            if (m_ScriptEngine.Config.GetBoolean("AllowMODFunctions", false))
                m_MODFunctionsEnabled = true;

            m_comms = m_ScriptEngine.World.RequestModuleInterface<IScriptModuleComms>();
            if (m_comms == null)
                m_MODFunctionsEnabled = false;
        }
Exemplo n.º 20
0
        public override void RegionLoaded(Scene scene)
        {
            base.World = scene;

            try
            {
                IScriptModuleComms m_scriptModule = base.World.RequestModuleInterface <IScriptModuleComms>();
                m_scriptModule.RegisterScriptInvocation(this, "osRemoteScriptPin");
            }
            catch (Exception e)
            {
                base.Logger.WarnFormat("[" + Name + "]: script method registration failed; {0}", e.Message);
            }
        }
Exemplo n.º 21
0
        public void Initialize(
            IScriptEngine scriptEngine, SceneObjectPart host, TaskInventoryItem item, WaitHandle coopSleepHandle)
        {
            m_ScriptEngine = scriptEngine;
            m_host = host;
            m_item = item;

            if (m_ScriptEngine.Config.GetBoolean("AllowMODFunctions", false))
                m_MODFunctionsEnabled = true;

            m_comms = m_ScriptEngine.World.RequestModuleInterface<IScriptModuleComms>();
            if (m_comms == null)
                m_MODFunctionsEnabled = false;
        }
Exemplo n.º 22
0
        public override void RegionLoaded(Scene scene)
        {
            base.World = scene;

            try
            {
                IScriptModuleComms m_scriptModule = base.World.RequestModuleInterface <IScriptModuleComms>();

                m_scriptModule.RegisterScriptInvocation(this, "osStartScriptEvents");
                m_scriptModule.RegisterScriptInvocation(this, "osStopScriptEvents");
                m_scriptModule.RegisterScriptInvocation(this, "osTriggerCustomEvent");

                m_scriptModule.RegisterConstant("EVENT_CUSTOM", 0);
                m_scriptModule.RegisterConstant("EVENT_NEWPRESENCE", 1);
                m_scriptModule.RegisterConstant("EVENT_REMOVEPRESENCE", 2);
                m_scriptModule.RegisterConstant("EVENT_AVATARENTERPARCEL", 3);
                m_scriptModule.RegisterConstant("EVENT_AVATARTELEPORT", 4);

                m_scriptModule.RegisterConstant("EVENT_DATASTORAGESET", 1001);
                m_scriptModule.RegisterConstant("EVENT_DATASTORAGEREMOVE", 1002);

                m_scriptModule.RegisterConstant("EVENT_EASYDIALOGTIMEOUT", 2001);

                m_scriptModule.RegisterConstant("EVENT_GENERIC", 42001337);
            }
            catch (Exception e)
            {
                base.Logger.WarnFormat("[" + Name + "]: Script method registration failed; {0}", e.Message);
            }

            ScriptEngine = base.World.RequestModuleInterface <IScriptModule>();

            base.World.EventManager.OnScriptReset  += onScriptReset;
            base.World.EventManager.OnRemoveScript += onScriptRemove;

            //DataStorage Events
            DataStorageEvents.onDeleteDataValue += scriptevent_onDeleteDataValue;
            DataStorageEvents.onSetDataValue    += scriptevent_onSetDataValue;
            DataStorageEvents.onRateLimit       += scriptevent_onRateLimit;

            //EasyDialog Events
            EasyDialogEvents.onDialogTimeout += scriptevent_onDialogTimeout;

            //Events for Scripts
            base.World.EventManager.OnNewPresence             += scriptevent_OnNewPresence;
            base.World.EventManager.OnRemovePresence          += scriptevent_OnRemovePresence;
            base.World.EventManager.OnAvatarEnteringNewParcel += scriptevent_OnAvatarEnteringNewParcel;
            base.World.EventManager.OnTeleportStart           += scriptevent_OnTeleportStart;
        }
Exemplo n.º 23
0
        //internal IWindLightSettingsModule m_lightShareModule;

        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;

            if (m_ScriptEngine.Config.GetBoolean("AllowLightShareFunctions", false))
                m_LSFunctionsEnabled = true;

            m_comms = World.RequestModuleInterface<IScriptModuleComms>();
            if (m_comms == null)
                m_LSFunctionsEnabled = false;
        }
Exemplo n.º 24
0
        public void Initialize(IScriptEngine ScriptEngine, SceneObjectPart host, TaskInventoryItem item)
        {
            m_ScriptEngine = ScriptEngine;
            m_host         = host;

            if (m_ScriptEngine.Config.GetBoolean("AllowLightShareFunctions", false))
            {
                m_LSFunctionsEnabled = true;
            }

            m_comms = m_ScriptEngine.World.RequestModuleInterface <IScriptModuleComms>();
            if (m_comms == null)
            {
                m_LSFunctionsEnabled = false;
            }
        }
Exemplo n.º 25
0
 public void PostInitialise()
 {
     if (m_enabled)
     {
         //Register for modSendCommand events from inworld scripts
         //If we try to do this as part of Initialise() we get an UnhandledEventException.
         m_scriptmod = m_scene.RequestModuleInterface <IScriptModuleComms>();
         m_scriptmod.OnScriptCommand += new ScriptCommand(OnModSendCommand);
         //Register for chat commands so we can receive orders to generate new plants
         m_scene.EventManager.OnChatFromClient += OnChat;
         m_scene.EventManager.OnChatFromWorld  += OnChat;
         //Register for IDialogModule so we can send notices
         m_dialogmod = m_scene.RequestModuleInterface <IDialogModule>();
         m_log.Info("[vpgManager] Post-initialized... ");
     }
 }
Exemplo n.º 26
0
        // -----------------------------------------------------------------
        /// <summary>
        /// Called when all modules have been added for a region. This is
        /// where we hook up events
        /// </summary>
        // -----------------------------------------------------------------
        public void RegionLoaded(Scene scene)
        {
            if (m_enabled)
            {
                m_scene = scene;
                m_comms = m_scene.RequestModuleInterface <IScriptModuleComms>();
                if (m_comms == null)
                {
                    m_log.ErrorFormat("[Utility] ScriptModuleComms interface not defined");
                    m_enabled = false;
                    return;
                }

                m_comms.RegisterScriptInvocation(this, "GISConvertFromUTM");
            }
        }
        public override void RegionLoaded(Scene scene)
        {
            base.World = scene;

            base.World.Permissions.OnRezObject    += onRezObject;
            base.World.Permissions.OnDeleteObject += onDeleteObject;

            try
            {
                IScriptModuleComms m_scriptModule = base.World.RequestModuleInterface <IScriptModuleComms>();
                m_scriptModule.RegisterScriptInvocation(this, "osSetExtraPermission");
            }
            catch (Exception e)
            {
                base.Logger.WarnFormat("[" + Name + "]: script method registration failed; {0}", e.Message);
            }
        }
        public void RegionLoaded(Scene scene)
        {
            if (!m_enabled)
                return;

            m_scene = scene;

            m_scriptModuleComms = scene.RequestModuleInterface<IScriptModuleComms>();

            if (m_scriptModuleComms == null)
            {
                m_log.Error("IScriptModuleComms could not be found, cannot add script functions");
                return;
            }

            m_scriptModuleComms.RegisterScriptInvocations(this);
        }
Exemplo n.º 29
0
        public void Initialize(
            IScriptEngine scriptEngine, SceneObjectPart host, TaskInventoryItem item, WaitHandle coopSleepHandle)
        {
            m_ScriptEngine = scriptEngine;
            m_host         = host;
            m_item         = item;

            if (m_ScriptEngine.Config.GetBoolean("AllowMODFunctions", false))
            {
                m_MODFunctionsEnabled = true;
            }

            m_comms = m_ScriptEngine.World.RequestModuleInterface <IScriptModuleComms>();
            if (m_comms == null)
            {
                m_MODFunctionsEnabled = false;
            }
        }
Exemplo n.º 30
0
        //internal IWindLightSettingsModule m_lightShareModule;

        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;

            if (m_ScriptEngine.Config.GetBoolean("AllowLightShareFunctions", false))
            {
                m_LSFunctionsEnabled = true;
            }

            m_comms = World.RequestModuleInterface <IScriptModuleComms>();
            if (m_comms == null)
            {
                m_LSFunctionsEnabled = false;
            }
        }
Exemplo n.º 31
0
        public void RegionLoaded(Scene scene)
        {
            if (m_enabled)
            {
                m_scene = scene;
                m_comms = m_scene.RequestModuleInterface <IScriptModuleComms>();
                if (m_comms == null)
                {
                    m_log.WarnFormat("[ModInvoke] ScriptModuleComms interface not defined");
                    m_enabled = false;

                    return;
                }

                m_comms.RegisterScriptInvocation(this, "dsMemClear");
                m_comms.RegisterScriptInvocation(this, "dsMemCount");
                m_comms.RegisterScriptInvocation(this, "dsMemGet");
                m_comms.RegisterScriptInvocation(this, "dsMemSet");
            }
        }
Exemplo n.º 32
0
        public override void RegionLoaded(Scene scene)
        {
            base.World = scene;

            try
            {
                IScriptModuleComms m_scriptModule = base.World.RequestModuleInterface <IScriptModuleComms>();
                m_scriptModule.RegisterScriptInvocation(this, "osCreateBitmap");
                m_scriptModule.RegisterScriptInvocation(this, "osLoadBitmap");
                m_scriptModule.RegisterScriptInvocation(this, "osLoadBitmapFromURL");

                m_scriptModule.RegisterScriptInvocation(this, "osUnloadBitmap");
                m_scriptModule.RegisterScriptInvocation(this, "osSaveBitmap");
                m_scriptModule.RegisterScriptInvocation(this, "osResizeBitmap");
                m_scriptModule.RegisterScriptInvocation(this, "osGetBitmapPixel");
                m_scriptModule.RegisterScriptInvocation(this, "osSetBitmapPixel");
            }
            catch (Exception e)
            {
                base.Logger.WarnFormat("[" + Name + "]: script method registration failed; {0}", e.Message);
            }
        }
Exemplo n.º 33
0
        public override void RegionLoaded(Scene scene)
        {
            base.World = scene;

            try
            {
                IScriptModuleComms m_scriptModule = base.World.RequestModuleInterface <IScriptModuleComms>();

                m_scriptModule.RegisterScriptInvocation(this, "osTimerStart");
                m_scriptModule.RegisterScriptInvocation(this, "osTimerStop");
            }
            catch (Exception e)
            {
                base.Logger.WarnFormat("[" + Name + "]: script method registration failed; {0}", e.Message);
            }

            ScriptEngine = base.World.RequestModuleInterface <IScriptModule>();

            base.World.EventManager.OnScriptReset  += onScriptReset;
            base.World.EventManager.OnStopScript   += onScriptStop;
            base.World.EventManager.OnRemoveScript += onScriptRemove;
        }
        public void RegionLoaded(Scene scene)
        {
            m_scene = scene;

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

            if (comms != null)
            {
                comms.RegisterScriptInvocation(this, "llAttachToAvatarTemp");
                m_log.DebugFormat("[TEMP ATTACHS]: Registered script functions");
                m_console = scene.RequestModuleInterface <IRegionConsole>();

                if (m_console != null)
                {
                    m_console.AddCommand("TempAttachModule", false, "set auto_grant_attach_perms", "set auto_grant_attach_perms true|false", "Allow objects owned by the region owner or estate managers to obtain attach permissions without asking the user", SetAutoGrantAttachPerms);
                }
            }
            else
            {
                m_log.ErrorFormat("[TEMP ATTACHS]: Failed to register script functions");
            }
        }
Exemplo n.º 35
0
        public override void RegionLoaded(Scene scene)
        {
            base.World = scene;

            base.World.Permissions.OnRezObject       += onRezObject;
            base.World.Permissions.OnDeleteObject    += onDeleteObject;
            base.World.Permissions.OnDuplicateObject += onDuplicateObject;
            base.World.Permissions.OnEditObject      += onEditObject;

            try
            {
                IScriptModuleComms m_scriptModule = base.World.RequestModuleInterface <IScriptModuleComms>();

                m_scriptModule.RegisterScriptInvocation(this, "osGetNodeListToTarget");
                m_scriptModule.RegisterScriptInvocation(this, "osGetNodeList");
                m_scriptModule.RegisterScriptInvocation(this, "osGetNextNode");
                m_scriptModule.RegisterScriptInvocation(this, "osGetNodeConnections");
                m_scriptModule.RegisterScriptInvocation(this, "osClearNodeCache");
            }
            catch (Exception e)
            {
                base.Logger.WarnFormat("[" + Name + "]: script method registration failed; {0}", e.Message);
            }
        }
Exemplo n.º 36
0
        // -----------------------------------------------------------------
        /// <summary>
        /// Called when all modules have been added for a region. This is
        /// where we hook up events
        /// </summary>
        // -----------------------------------------------------------------
        public void RegionLoaded(Scene scene)
        {
            if (m_enabled)
            {
                m_scene = scene;
                m_comms = m_scene.RequestModuleInterface <IScriptModuleComms>();
                if (m_comms == null)
                {
                    m_log.ErrorFormat("[QuickSort] ScriptModuleComms interface not defined");
                    m_enabled = false;
                    return;
                }

                //m_comms.RegisterScriptInvocation("QuickSortConfig",SI_QuickSortConfig, new Type[] { typeof(string), typeof(string) }, typeof(int));
                //m_comms.RegisterScriptInvocation("QuickSortState",SI_QuickSortState, new Type[] { typeof(string) }, typeof(string));
                m_comms.RegisterScriptInvocation(this, "QuickSortConfig");
                m_comms.RegisterScriptInvocation(this, "QuickSortState");

                m_probeTimer.Enabled   = false;
                m_probeTimer.AutoReset = false;
                m_probeTimer.Interval  = 500; // 500 milliseconds wait to start async ops
                m_probeTimer.Elapsed  += new ElapsedEventHandler(UpdateSortObjects);
            }
        }
Exemplo n.º 37
0
        // -----------------------------------------------------------------
        /// <summary>
        /// Called when all modules have been added for a region. This is
        /// where we hook up events
        /// </summary>
        // -----------------------------------------------------------------
        public void RegionLoaded(Scene scene)
        {
            if (m_enabled)
            {
                m_scene = scene;
                m_comms = m_scene.RequestModuleInterface <IScriptModuleComms>();
                if (m_comms == null)
                {
                    m_log.ErrorFormat("[NBody] ScriptModuleComms interface not defined");
                    m_enabled = false;
                    return;
                }

                m_comms.RegisterScriptInvocation(this, "NBCreateDomain");
                m_comms.RegisterScriptInvocation(this, "NBDestroyDomain");
                m_comms.RegisterScriptInvocation(this, "NBSetTimeScale");
                m_comms.RegisterScriptInvocation(this, "NBEnableDomain");
                m_comms.RegisterScriptInvocation(this, "NBDisableDomain");

                m_comms.RegisterScriptInvocation(this, "NBAddEntity");
                m_comms.RegisterScriptInvocation(this, "NBRemoveEntity");
                m_comms.RegisterScriptInvocation(this, "NBDump");
            }
        }
        public void RegionLoaded(Scene scene)
        {
            if (!m_enabled)
                return;

            m_scene = scene;

            m_modComms = scene.RequestModuleInterface<IScriptModuleComms>();

            if (m_modComms == null)
            {
                m_log.Error(
                        "IScriptModuleComms could not be found, cannot add" +
                        " script functions");
                return;
            }

            m_modComms.RegisterScriptInvocations(this);

            m_scene.EventManager.OnRemovePresence += OnRemovePresence;
            m_scene.EventManager.OnNewPresence += OnNewPresence;
            m_scene.EventManager.OnObjectBeingRemovedFromScene += OnObjectBeingRemovedFromScene;
            m_scene.EventManager.OnAttach += OnAttach;
        }
Exemplo n.º 39
0
 public CSCodeGenerator(IScriptModuleComms comms)
 {
     m_comms = comms;
     ResetCounters();
 }
Exemplo n.º 40
0
        // -----------------------------------------------------------------
        /// <summary>
        /// Called when all modules have been added for a region. This is 
        /// where we hook up events
        /// </summary>
        // -----------------------------------------------------------------
        public void RegionLoaded(Scene scene)
        {
            if (m_enabled)
            {
                m_scene = scene;
                m_comms = m_scene.RequestModuleInterface<IScriptModuleComms>();
                if (m_comms == null)
                {
                    m_log.ErrorFormat("[NBody] ScriptModuleComms interface not defined");
                    m_enabled = false;
                    return;
                }

                m_comms.RegisterScriptInvocation(this,"NBCreateDomain");
                m_comms.RegisterScriptInvocation(this,"NBDestroyDomain");
                m_comms.RegisterScriptInvocation(this,"NBSetTimeScale");
                m_comms.RegisterScriptInvocation(this,"NBEnableDomain");
                m_comms.RegisterScriptInvocation(this,"NBDisableDomain");

                m_comms.RegisterScriptInvocation(this,"NBAddEntity");
                m_comms.RegisterScriptInvocation(this,"NBRemoveEntity");
                m_comms.RegisterScriptInvocation(this,"NBDump");
            }
        }
        // -----------------------------------------------------------------
        /// <summary>
        /// Called when all modules have been added for a region. This is 
        /// where we hook up events
        /// </summary>
        // -----------------------------------------------------------------
        public void RegionLoaded(Scene scene)
        {
            if (m_enabled)
            {
                m_scene = scene;
                m_comms = m_scene.RequestModuleInterface<IScriptModuleComms>();
                if (m_comms == null)
                {
                    m_log.ErrorFormat("[JsonStoreScripts]: ScriptModuleComms interface not defined");
                    m_enabled = false;
                    return;
                }

                m_store = m_scene.RequestModuleInterface<IJsonStoreModule>();
                if (m_store == null)
                {
                    m_log.ErrorFormat("[JsonStoreScripts]: JsonModule interface not defined");
                    m_enabled = false;
                    return;
                }

                try
                {
                    m_comms.RegisterScriptInvocations(this);
                    m_comms.RegisterConstants(this);
                }
                catch (Exception e)
                {
                    // See http://opensimulator.org/mantis/view.php?id=5971 for more information
                    m_log.WarnFormat("[JsonStoreScripts]: script method registration failed; {0}", e.Message);
                    m_enabled = false;
                }
            }
        }
Exemplo n.º 42
0
 public void RegionLoaded(Scene scene)
 {
     m_scene = scene;
     m_commsMod = m_scene.RequestModuleInterface<IScriptModuleComms>();
     m_commsMod.OnScriptCommand += ProcessScriptCommand;
     rayTracerRequestHandler = new RayTracerRequestHandler(m_commsMod, m_scene);
 }
Exemplo n.º 43
0
        // -----------------------------------------------------------------
        /// <summary>
        /// Called when all modules have been added for a region. This is 
        /// where we hook up events
        /// </summary>
        // -----------------------------------------------------------------
        public void RegionLoaded(Scene scene)
        {
            if (m_enabled)
            {
                m_scene = scene;
                m_comms = m_scene.RequestModuleInterface<IScriptModuleComms>();
                if (m_comms == null)
                {
                    m_log.ErrorFormat("[Utility] ScriptModuleComms interface not defined");
                    m_enabled = false;
                    return;
                }

                m_comms.RegisterScriptInvocation(this,"GISConvertFromUTM");
            }
        }
        // -----------------------------------------------------------------
        /// <summary>
        /// Called when all modules have been added for a region. This is 
        /// where we hook up events
        /// </summary>
        // -----------------------------------------------------------------
        public void RegionLoaded(Scene scene)
        {
            if (m_enabled)
            {
                m_scene = scene;
                m_comms = m_scene.RequestModuleInterface<IScriptModuleComms>();
                if (m_comms == null)
                {
                    m_log.ErrorFormat("[JsonStoreScripts] ScriptModuleComms interface not defined");
                    m_enabled = false;
                    return;
                }

                m_store = m_scene.RequestModuleInterface<IJsonStoreModule>();
                if (m_store == null)
                {
                    m_log.ErrorFormat("[JsonStoreScripts] JsonModule interface not defined");
                    m_enabled = false;
                    return;
                }
                    
                try
                {
                    m_comms.RegisterScriptInvocation(this,"JsonCreateStore");
                    m_comms.RegisterScriptInvocation(this,"JsonDestroyStore");

                    m_comms.RegisterScriptInvocation(this,"JsonReadNotecard");
                    m_comms.RegisterScriptInvocation(this,"JsonWriteNotecard");

                    m_comms.RegisterScriptInvocation(this,"JsonTestPath");
                    m_comms.RegisterScriptInvocation(this,"JsonTestPathJson");

                    m_comms.RegisterScriptInvocation(this,"JsonGetValue");
                    m_comms.RegisterScriptInvocation(this,"JsonGetValueJson");

                    m_comms.RegisterScriptInvocation(this,"JsonTakeValue");
                    m_comms.RegisterScriptInvocation(this,"JsonTakeValueJson");

                    m_comms.RegisterScriptInvocation(this,"JsonReadValue");
                    m_comms.RegisterScriptInvocation(this,"JsonReadValueJson");

                    m_comms.RegisterScriptInvocation(this,"JsonSetValue");
                    m_comms.RegisterScriptInvocation(this,"JsonSetValueJson");

                    m_comms.RegisterScriptInvocation(this,"JsonRemoveValue");
                }
                catch (Exception e)
                {
                    // See http://opensimulator.org/mantis/view.php?id=5971 for more information
                    m_log.WarnFormat("[JsonStroreScripts] script method registration failed; {0}",e.Message);
                    m_enabled = false;
                }
            }
        }
Exemplo n.º 45
0
 public CSCodeGenerator(IScriptModuleComms comms)
 {
     m_comms = comms;
     ResetCounters();
 }
 public void RegionLoaded(Scene scene)
 {
     m_ScriptComms = scene.RequestModuleInterface<IScriptModuleComms>();
     if (m_ScriptComms != null)
     {
         m_ScriptComms.OnScriptCommand += OnScriptCommand;
         m_ScriptModules.Add(m_ScriptComms);
     }
 }
        // -----------------------------------------------------------------
        /// <summary>
        /// Called when all modules have been added for a region. This is 
        /// where we hook up events
        /// </summary>
        // -----------------------------------------------------------------
        public void RegionLoaded(Scene scene)
        {
            if (m_enabled)
            {
                m_scene = scene;
                m_comms = m_scene.RequestModuleInterface<IScriptModuleComms>();
                if (m_comms == null)
                {
                    m_log.ErrorFormat("[QuickSort] ScriptModuleComms interface not defined");
                    m_enabled = false;
                    return;
                }

                //m_comms.RegisterScriptInvocation("QuickSortConfig",SI_QuickSortConfig, new Type[] { typeof(string), typeof(string) }, typeof(int));
                //m_comms.RegisterScriptInvocation("QuickSortState",SI_QuickSortState, new Type[] { typeof(string) }, typeof(string));
                m_comms.RegisterScriptInvocation(this,"QuickSortConfig");
                m_comms.RegisterScriptInvocation(this,"QuickSortState");

                m_probeTimer.Enabled = false;
                m_probeTimer.AutoReset = false;
                m_probeTimer.Interval = 500; // 500 milliseconds wait to start async ops
                m_probeTimer.Elapsed += new ElapsedEventHandler(UpdateSortObjects);
            }
        }
Exemplo n.º 48
0
        /// <summary>
        /// Initialise all variables needed to be used by this ray tracer model. 
        /// </summary>
        /// <param name="scene">The scene in the world</param>
        /// <param name="setOfvariables">Set of variable values from the remote control</param>
        /// <param name="_scriptID">UUID of the script which called this function</param>
        public void Initialise(Scene _scene, string _setOfVariables, UUID _scriptID)
        {
            m_scene = _scene;
            m_commsMod = m_scene.RequestModuleInterface<IScriptModuleComms>();
            scriptID = _scriptID;
            setOfVariables = _setOfVariables;

            //Initialise variables parsed from the remote control. 
            int noOfInitVar = initialiseVariables(setOfVariables);
            m_log.DebugFormat("[RAY TRACER INITIALISATION]: total number of initialised variables = " + noOfInitVar.ToString());

            //Get all the entities in the world
            try { m_prims = m_scene.GetEntities(); }
            catch (Exception ex) { }

            //Initialise transmitter and receiver.
            if (!findTransmitterAndReceiver())
            {
                m_log.DebugFormat("[Ray Tracer PostInit] Transmitter and/or receiver not Found!");
                throw new Exception("Cannot find either Transmitter Tx or Receiver Ry");
            }

            //Initialise worldObjects. WorldObjects contains all the parts of the objects in the world which
            //the distance from itself to the transmitter is less than the MAX_DISTANCE. This is to reduce the
            //number of parts that we have to look at, i.e. reduces the computations time to find reflections. 

            worldObjects = new List<SceneObjectPart>();
            for (int i = 0; i < m_prims.Length; i++)
            {
                if (m_prims[i] is SceneObjectGroup)
                {
                    SceneObjectGroup sog = (SceneObjectGroup)m_prims[i];
                    sog.ForEachPart(delegate(SceneObjectPart part)
                    {
                        if (Vector3.Distance(part.AbsolutePosition, transmitter.RootPart.AbsolutePosition) <= MAX_DISTANCE || part.Name.CompareTo("Ry") == 0)
                        {
                            worldObjects.Add(part);
                        }
                    });
                }
            }
            //Initialise pathList for all reflections from 0 to max reflection
            pathHits = new Dictionary<string, PathFromTxToRy>[MAX_REFLECTIONS + 1];
            for (int i = 0; i < MAX_REFLECTIONS + 1; i++)
            {
                pathHits[i] = new Dictionary<string, PathFromTxToRy>();
            }
            
            m_log.DebugFormat("[RAY TRACER INITIALISATION]: Complete!");

        }
Exemplo n.º 49
0
 public CSCodeGenerator(IScriptModuleComms comms, bool insertCoopTerminationChecks)
 {
     m_comms = comms;
     m_insertCoopTerminationChecks = insertCoopTerminationChecks;
     ResetCounters();
 }
Exemplo n.º 50
0
        /// <summary>
        /// Keep a record of the previous node when we do the parsing.
        /// </summary>
        /// <remarks>
        /// We do this here because the parser generated by CSTools does not retain a reference to its parent node.
        /// The previous node is required so we can correctly insert co-op termination checks when required.
        /// </remarks>
//        private SYMBOL m_previousNode;

        /// <summary>
        /// Creates an 'empty' CSCodeGenerator instance.
        /// </summary>
        public CSCodeGenerator()
        {
            m_comms = null;
            ResetCounters();
        }
Exemplo n.º 51
0
        public void RegionLoaded(Scene scene)
        {
            if (m_enabled)
            {
                m_scene = scene;
                m_comms = m_scene.RequestModuleInterface<IScriptModuleComms>();
                if (m_comms == null)
                {
                    m_log.WarnFormat("[ModInvoke] ScriptModuleComms interface not defined");
                    m_enabled = false;

                    return;
                }

                m_comms.RegisterScriptInvocation(this,"ModTest0");
                m_comms.RegisterScriptInvocation(this,"ModTest1");
                m_comms.RegisterScriptInvocation(this,"ModTest2");
                m_comms.RegisterScriptInvocation(this,"ModTest3");
                m_comms.RegisterScriptInvocation(this,"ModTest4");
                m_comms.RegisterScriptInvocation(this,"ModTest5");
                m_comms.RegisterScriptInvocation(this,"ModTest6");
                m_comms.RegisterScriptInvocation(this,"ModTest7");
                m_comms.RegisterScriptInvocation(this,"ModTest8");

                m_comms.RegisterScriptInvocation(this,"ModTestR1");

                m_comms.RegisterScriptInvocation(this,"ModTest1p");
                m_comms.RegisterScriptInvocation(this,"ModTest2p");
                m_comms.RegisterScriptInvocation(this,"ModTest3p");
                m_comms.RegisterScriptInvocation(this,"ModTest4p");
                m_comms.RegisterScriptInvocation(this,"ModTest5p");

                m_comms.RegisterConstant("ModConstantInt1",25);
                m_comms.RegisterConstant("ModConstantFloat1",25.000f);
                m_comms.RegisterConstant("ModConstantString1","abcdefg");
            }
        }
Exemplo n.º 52
0
        public void RegionLoaded(Scene scene)
        {
            if (!m_enabled)
                return;

            m_scene = scene;

            m_scriptModuleComms = scene.RequestModuleInterface<IScriptModuleComms>();

            if (m_scriptModuleComms == null)
            {
                m_log.Error("IScriptModuleComms could not be found, cannot add script functions");
                return;
            }

            #region Constants

            m_scriptModuleComms.RegisterConstant("MATH_TWO_PHI",
                    (float)(MATH_PHI * 2.0));
            m_scriptModuleComms.RegisterConstant("MATH_PHI_BY_TWO",
                    (float)(MATH_PHI / 2.0));

            #endregion

            m_scriptModuleComms.RegisterScriptInvocations(this);
            m_scriptModuleComms.RegisterConstants(this);
        }
Exemplo n.º 53
0
 public void PostInitialise()
 {
     if (m_enabled)
     {
         //Register for modSendCommand events from inworld scripts
         //If we try to do this as part of Initialise() we get an UnhandledEventException.
         m_scriptmod = m_scene.RequestModuleInterface<IScriptModuleComms>();
         m_scriptmod.OnScriptCommand += new ScriptCommand(OnModSendCommand);
         //Register for chat commands so we can receive orders to generate new plants
         m_scene.EventManager.OnChatFromClient += OnChat;
         m_scene.EventManager.OnChatFromWorld += OnChat;
         //Register for IDialogModule so we can send notices
         m_dialogmod = m_scene.RequestModuleInterface<IDialogModule>();
         m_log.Info("[vpgManager] Post-initialized... ");
     }
 }