当前位置: 首页>>代码示例>>C#>>正文


C# ScriptData.SetEventParams方法代码示例

本文整理汇总了C#中Aurora.ScriptEngine.AuroraDotNetEngine.ScriptData.SetEventParams方法的典型用法代码示例。如果您正苦于以下问题:C# ScriptData.SetEventParams方法的具体用法?C# ScriptData.SetEventParams怎么用?C# ScriptData.SetEventParams使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Aurora.ScriptEngine.AuroraDotNetEngine.ScriptData的用法示例。


在下文中一共展示了ScriptData.SetEventParams方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AddEventSchQueue

        public void AddEventSchQueue(ScriptData ID, string FunctionName, DetectParams[] qParams, EventPriority priority, params object[] param)
        {
            QueueItemStruct QIS;

            if (ID == null || ID.Script == null || ID.IgnoreNew)
                return;

            if (!ID.SetEventParams(FunctionName, qParams)) // check events delay rules
                return;

            QIS = new QueueItemStruct();
            QIS.EventsProcData = new ScriptEventsProcData ();
            QIS.ID = ID;
            QIS.functionName = FunctionName;
            QIS.llDetectParams = qParams;
            QIS.param = param;
            QIS.VersionID = Interlocked.Read(ref ID.VersionID);
            QIS.State = ID.State;
            QIS.CurrentlyAt = null;

            lock (ScriptEvents)
            {
                ScriptEvents.Enqueue (QIS);
                ScriptEventCount++;
#if Debug
                m_log.Warn (ScriptEventCount + ", " + QIS.functionName);
#endif
            }

            long threadCount = Interlocked.Read (ref scriptThreadpool.nthreads);
            if (threadCount == 0 || threadCount < (ScriptEventCount + (SleepingScriptEventCount / 2)) * EventPerformance)
            {
                scriptThreadpool.QueueEvent (eventLoop, 2);
            }
        }
开发者ID:RevolutionSmythe,项目名称:Aurora-Sim,代码行数:35,代码来源:MaintenanceThread.cs

示例2: AddEventSchQueue

        public void AddEventSchQueue(ScriptData ID, string FunctionName, DetectParams[] qParams, EventPriority priority,
                                     params object[] param)
        {
            QueueItemStruct QIS;

            if (ID == null || ID.Script == null || ID.IgnoreNew)
                return;

            if (!ID.SetEventParams(FunctionName, qParams)) // check events delay rules
                return;

            QIS = new QueueItemStruct
                      {
                          EventsProcData = new ScriptEventsProcData(),
                          ID = ID,
                          functionName = FunctionName,
                          llDetectParams = qParams,
                          param = param,
                          VersionID = Interlocked.Read(ref ID.VersionID),
                          State = ID.State,
                          CurrentlyAt = null
                      };

            ScriptEvents.Enqueue(QIS);

            long threadCount = Interlocked.Read(ref scriptThreadpool.nthreads);
            if (threadCount == 0 || threadCount < (ScriptEvents.Count + (SleepingScriptEventCount/2))*EventPerformance)
            {
                scriptThreadpool.QueueEvent(eventLoop, 2);
            }
        }
开发者ID:velus,项目名称:Async-Sim-Testing,代码行数:31,代码来源:MaintenanceThread.cs

示例3: AddEventSchQueue

        public void AddEventSchQueue(ScriptData ID, string FunctionName, DetectParams[] qParams, int VersionID, EventPriority priority, params object[] param)
        {
            QueueItemStruct QIS;

            if (ID == null || ID.EventsProcData.IgnoreNew)
                return;

            if (!ID.SetEventParams(FunctionName, qParams)) // check events delay rules
                return;

            QIS = new QueueItemStruct();
            QIS.ID = ID;
            QIS.functionName = FunctionName;
            QIS.llDetectParams = qParams;
            QIS.param = param;
            QIS.VersionID = VersionID;
            QIS.State = ID.State;
            QIS.CurrentlyAt = null;

            lock (ID.EventsProcData)
            {
                ID.EventsProcDataLocked = true;

                if (ID.EventsProcData.EventsQueue.Count > 100)
                {
                    ID.EventsProcDataLocked = false;
                    return;
                }

                ID.EventsProcData.EventsQueue.Enqueue(QIS);
                lock (ScriptIDs)
                {
                    if (!ScriptIDs.Contains(ID))
                    {
                        ID.EventsProcData.State = (int)ScriptEventsState.Idle;
                        ID.EventsProcData.thread = null;
                        ScriptIDs.AddLast(ID);
                        NScriptIDs++;
                        ID.InEventsProcData = true;
                    }
                }
            }
            ID.EventsProcDataLocked = false;

            lock (WorkersLock)
            {
                if (WorkersLock.nWorkers < MaxScriptThreads)
                {
                    Scriptthreadpool.QueueEvent(loop, 2);
                }
            }
        }
开发者ID:NickyPerian,项目名称:Aurora,代码行数:52,代码来源:MaintenanceThread.cs


注:本文中的Aurora.ScriptEngine.AuroraDotNetEngine.ScriptData.SetEventParams方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。