Esempio n. 1
0
 public void ExecuteCommand(ref ScriptStructure scriptContainer, EventParams p)
 {
     m_log.DebugFormat("[{0}] ######################################################", Name);
     m_log.DebugFormat("[{0}] Command execution ItemID {1}: \"{2}\".", Name, scriptContainer.ItemID, p.EventName);
     scriptContainer.ExecuteEvent(p);
     m_log.DebugFormat("[{0}] ######################################################", Name);
 }
Esempio n. 2
0
        public void ExecuteCommand(EventParams p)
        {
            ScriptStructure ss = new ScriptStructure();

            if (TryGetScript(p.LocalID, p.ItemID, ref ss))
            {
                ExecuteCommand(ref ss, p);
            }
        }
Esempio n. 3
0
 public void Executors_Execute(ScriptStructure scriptContainer, EventParams p)
 {
     // Execute a command on all executors
     lock (Executors)
     {
         foreach (IScriptExecutor exec in Executors.Values)
         {
             exec.ExecuteCommand(ref scriptContainer, p);
         }
     }
 }
Esempio n. 4
0
 public void Executors_Execute(ScriptStructure scriptContainer, EventParams p)
 {
     // Execute a command on all executors
     lock (Executors)
     {
         foreach (IScriptExecutor exec in Executors.Values)
         {
             exec.ExecuteCommand(ref scriptContainer, p);
         }
     }
 }
Esempio n. 5
0
 public void Executors_Execute(EventParams p)
 {
     // Execute a command on all executors
     lock (Executors)
     {
         foreach (IScriptExecutor exec in Executors.Values)
         {
             exec.ExecuteCommand(p);
         }
     }
 }
Esempio n. 6
0
 public void Executors_Execute(EventParams p)
 {
     // Execute a command on all executors
     lock (Executors)
     {
         foreach (IScriptExecutor exec in Executors.Values)
         {
             exec.ExecuteCommand(p);
         }
     }
 }
Esempio n. 7
0
        private void ExecuteMethod(EventParams p, bool isEvent)
        {
            // First time initialization?
            if (!Initialized)
            {
                Initialized = true;
                CacheInternalFunctions();
            }

            lock (InternalFunctions)
            {
                // Make function name
                string FunctionName;
                if (isEvent)
                {
                    FunctionName = State + "_event_" + p.EventName;
                }
                else
                {
                    FunctionName = p.EventName;
                }

                // Check if this function exist
                if (!InternalFunctions.ContainsKey(FunctionName))
                {
                    // TODO: Send message in-world
                    m_log.ErrorFormat("[{0}] Script function \"{1}\" was not found.", Name, FunctionName);
                    return;
                }

                // Execute script function
                try
                {
                    InternalFunctions[FunctionName].DynamicInvoke(p.Params);
                }
                catch (Exception e)
                {
                    m_log.ErrorFormat("[{0}] Execute \"{1}\" failed: {2}", Name, FunctionName, e.ToString());
                }
            }
        }
Esempio n. 8
0
        private void ExecuteMethod(EventParams p, bool isEvent)
        {
            // First time initialization?
            if (!Initialized)
            {
                Initialized = true;
                CacheInternalFunctions();
            }

            lock (InternalFunctions)
            {
                // Make function name
                string FunctionName;
                if (isEvent)
                    FunctionName = State + "_event_" + p.EventName;
                else
                    FunctionName = p.EventName;

                // Check if this function exist
                if (!InternalFunctions.ContainsKey(FunctionName))
                {
                    // TODO: Send message in-world
                    m_log.ErrorFormat("[{0}] Script function \"{1}\" was not found.", Name, FunctionName);
                    return;
                }

                // Execute script function
                try
                {
                    InternalFunctions[FunctionName].DynamicInvoke(p.Params);
                }
                catch (Exception e)
                {
                    m_log.ErrorFormat("[{0}] Execute \"{1}\" failed: {2}", Name, FunctionName, e.ToString());
                }
            }
        }
Esempio n. 9
0
 public void ExecuteMethod(EventParams p)
 {
     ExecuteMethod(p, false);
 }
Esempio n. 10
0
 public void ExecuteEvent(EventParams p)
 {
     ExecuteMethod(p, true);
 }
Esempio n. 11
0
 public void ExecuteMethod(EventParams p)
 {
     ExecuteMethod(p, false);
 }
Esempio n. 12
0
 public void ExecuteEvent(EventParams p)
 {
     ExecuteMethod(p, true);
 }
Esempio n. 13
0
 public void ExecuteCommand(ref ScriptStructure scriptContainer, EventParams p)
 {
     m_log.DebugFormat("[{0}] ######################################################", Name);
     m_log.DebugFormat("[{0}] Command execution ItemID {1}: \"{2}\".", Name, scriptContainer.ItemID, p.EventName);
     scriptContainer.ExecuteEvent(p);
     m_log.DebugFormat("[{0}] ######################################################", Name);
 }
Esempio n. 14
0
 public void ExecuteCommand(EventParams p)
 {
     ScriptStructure ss = new ScriptStructure();
     if (TryGetScript(p.LocalID, p.ItemID, ref ss))
         ExecuteCommand(ref ss, p);
 }