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

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