示例#1
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;
                }
            }
        }
示例#2
0
 /// -----------------------------------------------------------------
 /// <summary>
 /// </summary>
 /// -----------------------------------------------------------------
 public ObjectHandlers(Scene scene, IDispatcherModule dispatcher, string domain) : base(scene, dispatcher, domain)
 {
     m_jsonstore = m_scene.RequestModuleInterface <IJsonStoreModule>();
     if (m_jsonstore == null)
     {
         m_log.WarnFormat("[ObjectHandlers] IJsonStoreModule interface not defined");
     }
 }
示例#3
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;
                }
            }
        }
        // -----------------------------------------------------------------
        /// <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;
                }
            }
        }
        // -----------------------------------------------------------------
        /// <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;
                }
            }
        }