Beispiel #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);
 }
Beispiel #2
0
        public void ExecuteCommand(EventParams p)
        {
            ScriptStructure ss = new ScriptStructure();

            if (TryGetScript(p.LocalID, p.ItemID, ref ss))
            {
                ExecuteCommand(ref ss, p);
            }
        }
Beispiel #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);
         }
     }
 }
Beispiel #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);
         }
     }
 }
Beispiel #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);
         }
     }
 }
Beispiel #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);
         }
     }
 }
Beispiel #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());
                }
            }
        }
Beispiel #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());
                }
            }
        }
Beispiel #9
0
 public void ExecuteMethod(EventParams p)
 {
     ExecuteMethod(p, false);
 }
Beispiel #10
0
 public void ExecuteEvent(EventParams p)
 {
     ExecuteMethod(p, true);
 }
Beispiel #11
0
 public void ExecuteMethod(EventParams p)
 {
     ExecuteMethod(p, false);
 }
Beispiel #12
0
 public void ExecuteEvent(EventParams p)
 {
     ExecuteMethod(p, true);
 }
Beispiel #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);
 }
Beispiel #14
0
 public void ExecuteCommand(EventParams p)
 {
     ScriptStructure ss = new ScriptStructure();
     if (TryGetScript(p.LocalID, p.ItemID, ref ss))
         ExecuteCommand(ref ss, p);
 }