本文整理汇总了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);
}
}
示例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);
}
}
示例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);
}
}
}