예제 #1
0
        protected override IEnumerable <int> GetInterestingElementIds(IContainerElement element)
        {
            IMacroCommand c = element.InnerElement as IMacroCommand;

            yield return(c.Id);

            if (c.Condition != null)
            {
                yield return(c.Condition.ConditionalId);
            }
            IWaitConditionCommand wc = c as IWaitConditionCommand;

            if (wc != null && wc.AwaitedCondition != null)
            {
                yield return(wc.AwaitedCondition.ConditionalId);
            }
            IStartCommand sc = c as IStartCommand;

            if (sc != null)
            {
                yield return(sc.StartedElementId);
            }
            IStopCommand sc2 = c as IStopCommand;

            if (sc2 != null)
            {
                yield return(sc2.StoppedElementId);
            }
        }
예제 #2
0
 public Bot(IStartCommand startCommand, IEnterSignInDataCommand enterSignInDataCommand,
            IShowDirsCommand showDirsCommand, IPingCommand pingCommand,
            IIfConfingCommand ifConfingCommand, IMonitorModeCommand monitorModeCommand,
            IAllWifiInterception allWifiInterception, ISendPackagesCommand sendPackagesCommand,
            ICDCommand cDCommand, IBackCDCommand backCDCommand, IPWDCommand pWDCommand,
            IAirCrackNgCommand airCrackNgCommand, INetDiscoverCommand netDiscover,
            INmapCommand nmapCommand, ISMTPUserCheckCommand sMTPUserCheckCommand,
            IHelpCommand helpCommand, ISSHBruteForceCommand sSHBruteForceCommand,
            ISSHConnectCommand sSHConnectCommand)
 {
     _startCommand           = startCommand ?? throw new ArgumentNullException(nameof(startCommand), " was null");
     _enterSignInDataCommand = enterSignInDataCommand ?? throw new ArgumentNullException(nameof(enterSignInDataCommand), " was null");
     _showDirsCommand        = showDirsCommand ?? throw new ArgumentNullException(nameof(showDirsCommand), " was null");
     _pingCommand            = pingCommand ?? throw new ArgumentNullException(nameof(pingCommand), " was null");
     _ifConfigCommand        = ifConfingCommand ?? throw new ArgumentNullException(nameof(ifConfingCommand), " was null");
     _monitorModeCommand     = monitorModeCommand ?? throw new ArgumentNullException(nameof(monitorModeCommand), " was null");
     _allWifiInterception    = allWifiInterception ?? throw new ArgumentNullException(nameof(allWifiInterception), " was null");
     _sendPackagesCommand    = sendPackagesCommand ?? throw new ArgumentNullException(nameof(sendPackagesCommand), " was null");
     _cDCommand            = cDCommand ?? throw new ArgumentNullException(nameof(cDCommand), " was null");
     _backCDCommand        = backCDCommand ?? throw new ArgumentNullException(nameof(backCDCommand), " was null");
     _pWDCommand           = pWDCommand ?? throw new ArgumentNullException(nameof(pWDCommand), " was null");
     _airCrackNgCommand    = airCrackNgCommand ?? throw new ArgumentNullException(nameof(airCrackNgCommand), " was null");
     _netDiscoverCommand   = netDiscover ?? throw new ArgumentNullException(nameof(netDiscover), " was null.");
     _nmapCommand          = nmapCommand ?? throw new ArgumentNullException(nameof(nmapCommand), " was null.");
     _sMTPUserCheckCommand = sMTPUserCheckCommand ?? throw new ArgumentNullException(nameof(sMTPUserCheckCommand), " was null.");
     _helpCommand          = helpCommand ?? throw new ArgumentNullException(nameof(helpCommand), " was null.");
     _sSHBruteForceCommand = sSHBruteForceCommand ?? throw new ArgumentNullException(nameof(sSHBruteForceCommand), " was null.");
     _sSHConnectCommand    = sSHConnectCommand ?? throw new ArgumentNullException(nameof(sSHConnectCommand), " was null.");
 }
예제 #3
0
 public void VisitStartCommand(IStartCommand startCommand)
 {
     CheckCondition(startCommand);
     if (startCommand.StartedElement == null || Data.DataModule.ElementRepository.GetElement(startCommand.StartedElement.Id) == null)
     {
         AddError(m_ModelErrors, ModelError.ErrorSeverity.Error, StringResources.StartedElementNotFound, startCommand);
     }
 }
예제 #4
0
 public void VisitStartCommand(IStartCommand startCommand)
 {
     if (Client.Stopped)
     {
         return;
     }
     if (IsConditionFulfilled(startCommand.Condition))
     {
         if (startCommand.StartedElement != null && (!startCommand.StartedElement.IsEndless() || !MacroPlayers.Instance.IsElementRunning(startCommand.StartedElementId)))
         {
             PlayingModule.ProjectPlayer.SwitchElement(startCommand.StartedElementId);
         }
     }
 }
예제 #5
0
        public MinunDispatcher(
            IStartCommand startCommand,
            INutzerCommand nutzerCommand,
            IAnCommand anCommand,
            IAusCommand ausCommand,
            ICreateRaidCommand createRaidCommand,
            ICreateEventCommand createEventCommand,
            IRaidBossCommand raidBossCommand,
            IPokeCommand pokeCommand,
            IModifyRaidCommand modifyRaidCommand,
            ISpielCommand spielCommand,
            IGymsCommand gymsCommand,

            Commands.IHelpCommand helpCommand,
            Commands.ICancelCommand cancelCommand,

            ISpielAnswer spielAnswer
            ) : base()
        {
            this.commands.Add(startCommand);
            this.commands.Add(nutzerCommand);
            this.commands.Add(anCommand);
            this.commands.Add(ausCommand);
            this.commands.Add(createRaidCommand);
            this.commands.Add(createEventCommand);
            this.commands.Add(raidBossCommand);
            this.commands.Add(pokeCommand);
            this.commands.Add(modifyRaidCommand);
            this.commands.Add(spielCommand);
            this.commands.Add(gymsCommand);

            this.commands.Add(helpCommand);
            this.commands.Add(cancelCommand);

            helpCommand.RegisterAllCommands(this.commands.Select(x => x.Value).ToList());

            this.answers.Add(spielAnswer);
        }
예제 #6
0
        public RaidDispatcher(
            IStartCommand startGroupCommand,
            // IConfigureUserCommand startPrivatCommand,
            IHelpCommand helpCommand,
            ICancelCommand cancelCommand,
            IPollAnswer raidPollAnswer,
            ISettingsCommand settingsCommand,
            // ICreateRaidCommand createRaidCommand,
            IIvCommand ivCommand,
            IPokeCommand pokeCommand,
            IGymsCommand gymsCommand,
            MemberRemoved memberRemoved,
            MembersAdded memberAdded,
            IOwnerCommand ownerCommand,
            IUpdateRaidBossCommand updateRaidBossCommand
            )
        {
            this.commands.Add(startGroupCommand);
            // this.commands.Add(startPrivatCommand);
            this.commands.Add(helpCommand);
            this.commands.Add(cancelCommand);

            this.answers.Add(raidPollAnswer);
            this.commands.Add(settingsCommand);
            // this.commands.Add(createRaidCommand);
            this.commands.Add(ivCommand);
            this.commands.Add(gymsCommand);
            this.commands.Add(pokeCommand);
            this.commands.Add(ownerCommand);
            this.commands.Add(updateRaidBossCommand);


            this.memberAdded   = memberAdded;
            this.memberRemoved = memberRemoved;

            helpCommand.RegisterAllCommands(this.commands.Select(x => x.Value).ToList());
        }