Ejemplo n.º 1
0
 public EventData(PacketType packetType, PluginHandle target, BotEventHandler eventHandler, BotEventHandlerAttribute attribute)
 {
     Target = target;
     PacketType = packetType;
     EventHandler = eventHandler;
     Attribute = attribute;
 }
Ejemplo n.º 2
0
 public CommandData(PluginHandle target, BotCommandHandler commandHandler, 
     CommandDataAttributes attributes)
 {
     Target = target;
     Commands = attributes.CommandAttribute.Commands;
     CommandHandler = commandHandler;
     Attribute = attributes.CommandAttribute;
     Help = attributes.HelpAttribute;
     if (attributes.RoleAttribute != null)
         DefaultRole = attributes.RoleAttribute.Role.ToString();
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Creates a new plugin context based on the current packet and plugin.
 /// </summary>
 /// <param name="packet">The packet.</param>
 /// <param name="pluginHandle">The plugin handle.</param>
 /// <returns>Context.</returns>
 public PluginContext Create(EventPacket packet, PluginHandle pluginHandle)
 {
     // create a new context with a buttload of dependendies
     return generator(packet);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Adds the running plugin.
 /// </summary>
 /// <param name="plugin">The plugin.</param>
 /// <returns>True if successful, otherwise false.</returns>
 private bool AddPluginToRunningList(PluginHandle plugin)
 {
     var metadata = plugin.MetaData;
     if (metadata == null)
     {
         ReportInvalidPluginMetadataError(plugin);
         return false;
     }
     runningPlugins[metadata.Name] = plugin;
     return true;
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Generates a plugin context which is aware of the current 
 /// packet and the plugin executing it.
 /// </summary>
 private PluginContext GenerateContext(EventPacket packet, PluginHandle pluginHandle)
 {
     return contextFactory.Create(packet, pluginHandle);
 }