Add a source type to not command hooks
This commit is contained in:
parent
a50237304d
commit
fe628b0a9d
3 changed files with 23 additions and 7 deletions
|
@ -24,14 +24,26 @@ namespace Bot.NonCommands
|
|||
NotCommand[] nc = (NotCommand[])mi.GetCustomAttributes(typeof(NotCommand), false);
|
||||
if (nc.Length>0)
|
||||
{
|
||||
ThreadStart work = delegate
|
||||
bool OK = false;
|
||||
foreach(NotCommand nx in nc)
|
||||
{
|
||||
if (nx.SourceType.HasFlag(sourceLoc))
|
||||
{
|
||||
OK = true;
|
||||
}
|
||||
}
|
||||
if (OK)
|
||||
{
|
||||
|
||||
ThreadStart work = delegate
|
||||
{
|
||||
|
||||
mi.Invoke(Activator.CreateInstance(mi.DeclaringType), new object[] { request, agentKey, agentName, sourceLoc, originator });
|
||||
};
|
||||
Thread T = new Thread(work);
|
||||
T.Start();
|
||||
|
||||
mi.Invoke(Activator.CreateInstance(mi.DeclaringType), new object[] { request, agentKey, agentName, sourceLoc, originator });
|
||||
};
|
||||
Thread T = new Thread(work);
|
||||
T.Start();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue