public RemoveClientFromUserListTask(Dispatcher disp, TaskHandler handler, ClientConnectionList list, ClientConnection client, ObservableCollection<UserLocation> locs)
     : base(disp, handler)
 {
     ClientConnectionList = list;
     ClientConnection = client;
     UserLocations = locs;
 }
 public RespondToInitRequestMessage(Dispatcher disp, TaskHandler handler, ClientConnectionList list, ClientConnection client, InitRequestMessage msg)
     : base(disp, handler)
 {
     ClientConnectionList = list;
     ClientConnection = client;
     InitRequestMessage = msg;
 }
 public RespondToGeoPointMessageTask(Dispatcher disp, TaskHandler handler, ClientConnectionList list, ClientConnection client, ObservableCollection<UserLocation> locs, GeoPointMessage msg)
     : base(disp, handler)
 {
     ClientConnectionList = list;
     ClientConnection = client;
     GeoPointMessage = msg;
     UserLocations = locs;
 }
Example #4
0
        /// <summary>
        ///     Initialize Facades buy utilzing a dependency injection container
        /// </summary>
        /// <param name="injector"></param>
        private void InitializeHandlers(AdapterInjectionContainer injector)
        {
            _userHandler = new UserHandler(injector.GetUserAdapter());

            _studyHandler = new StudyHandler(injector.GetStudyAdapter());
            _fileHandler = new FileHandler(new BibtexParser());
            _exportHandler = new ExportHandler();
            _teamHandler = new TeamHandler(injector.GetTeamAdapter());
            _taskHandler = new TaskHandler(injector.GetTaskAdapter());
        }
Example #5
0
        /// <summary>
        /// Constructor for the task.
        /// </summary>
        /// <param name="controller">The controller usually represents a controller class for the application.
        /// In addition, this class must be a DispatcherObject associated with the GUI thread.</param>
        /// <param name="handler">Is an enum representing how this task should be executed.</param>
        public Task(Dispatcher dispatcher, TaskHandler handler)
        {
            if (dispatcher == null)
                throw new NullReferenceException("Arguments cannot be null.");

            IsCompleted = false;
            Dispatcher = dispatcher;
            TaskHandler = handler;

            if (TaskHandler == TaskHandler.Background)
                Worker = new BackgroundWorker();
        }
Example #6
0
        private void SaveOrUpdate()
        {
            //inserisco i parametri abituali
            _current.Subject = txtSub.Text;
            //_current.Resource = cboZon.SelectedItem as Resource;
            _current.Customer = txtCust.EditValue as Customer;
            //_current.Location = txtLoc.Text;
            //_current.Label = cboCaus.SelectedItem as WIN.SCHEDULING_APPLICATION.DOMAIN.ComboElements.Label;
            //_current.Operator = cboOp.SelectedItem as Operator;
            DataRange h1 = AppointmentUtils.CreateRangeForQuery(new DataRange(dtpIni.DateTime.Date, dtpFin.DateTime.Date));

            _current.StartDate = h1.Start;
            //artificio per evitare l'arrotondamento dei comandi ado su sql
            _current.EndDate     = h1.Finish.AddMinutes(-1);
            _current.Description = txtNote.Text;


            _current.Priority               = (PriorityType)Enum.Parse(typeof(PriorityType), cboPriority.Text);
            _current.ActivityState          = (ActivityState)Enum.Parse(typeof(ActivityState), cboState.Text);
            _current.PercentageCompleteness = Convert.ToInt32(spPerc.EditValue);



            if (dtpOut.EditValue == null)
            {
                _current.OutcomeDate = DateTime.MinValue;
            }
            else
            {
                _current.OutcomeDate = dtpOut.DateTime;
            }

            _current.Outcome            = cboOut.SelectedItem as Outcome;
            _current.OutcomeDescription = txtNoteRapp.Text;


            TaskHandler h = new TaskHandler();

            h.SaveOrUpdate(_current);


            _current.CalculateAppointmentInfo(Properties.Settings.Default.Main_DeadlineDaysBefore);
        }
Example #7
0
        public FamiliarsCombo(Config config)
        {
            Config       = config;
            Menu         = config.Menu;
            Main         = config.Main;
            Extensions   = config.Extensions;
            MultiSleeper = config.MultiSleeper;
            Owner        = config.Main.Context.Owner;

            config.Menu.ComboKeyItem.PropertyChanged      += ComboChanged;
            config.Menu.FamiliarsLockItem.PropertyChanged += FamiliarsLockChanged;

            if (config.Menu.FamiliarsLockItem)
            {
                config.Menu.FamiliarsLockItem.Item.SetValue(new KeyBind(config.Menu.FamiliarsLockItem.Value, KeyBindType.Toggle));
            }

            Handler = UpdateManager.Run(ExecuteAsync, true, false);
        }
Example #8
0
        public AutoCombo(Config config)
        {
            Config       = config;
            Menu         = config.Menu;
            Abilities    = config.Abilities;
            Extensions   = config.Extensions;
            MultiSleeper = config.MultiSleeper;
            Owner        = config.Main.Context.Owner;
            Prediction   = config.Main.Context.Prediction;

            Handler = UpdateManager.Run(ExecuteAsync, true, false);

            if (config.Menu.AutoComboItem)
            {
                Handler.RunAsync();
            }

            config.Menu.AutoComboItem.PropertyChanged += AutoComboChanged;
        }
 public VmController(
     GameHandler gameHandler,
     PlayerGameHandler pgh,
     GameTaskHandler gth,
     TaskHandler th,
     PlayerTaskHandler pth,
     AzureApi aapi,
     VirtualMachineHandler vmh,
     IUserHandler userHandler
     )
 {
     this.gameHandler = gameHandler;
     this.pgh         = pgh;
     this.gth         = gth;
     this.th          = th;
     this.pth         = pth;
     this.aapi        = aapi;
     this.vmh         = vmh;
     this.userHandler = userHandler;
 }
Example #10
0
        public async Task <IActionResult> CreateTask(TaskModel model)
        {
            if (ModelState.IsValid)
            {
                var job = new TaskHandler
                {
                    TaskMessage  = model.TaskMessage,
                    TaskName     = model.TaskName,
                    CompleteDate = DateTime.Now.AddDays(10),
                    CreateDate   = DateTime.Now,
                    DueDate      = DateTime.Now,
                    Checked      = false
                };

                await repo.Add(job);

                return(RedirectToAction("Index"));
            }
            return(CreateTask());
        }
        public void TestAddNewTask()
        {
            DbConnector dbC        = new DbConnector();
            string      respString = dbC.connect();

            Assert.AreSame("Done", respString);

            Task task = new Task();

            task.Title       = "Harvest Wheat 2018-11-05";
            task.Category    = "HARVESTING";
            task.Description = "The harvesting task is needed to be completed before 2018/11/08.";
            task.StartDate   = new DateTime(2018, 11, 6, 0, 0, 0);
            task.DueDate     = new DateTime(2018, 11, 8, 0, 0, 0);
            task.Status      = "PENDING";

            TaskHandler taskHand = new TaskHandler();
            bool        respCode = taskHand.addNewTask(dbC.getConn(), task);

            Assert.IsTrue(respCode);
        }
Example #12
0
 public GameSocket(ISerializer serializer) : base(serializer)
 {
     _bagHandler           = new BagHandler(this);
     _battleHandler        = new BattleHandler(this);
     _dailyActivityHandler = new DailyActivityHandler(this);
     _equipHandler         = new EquipHandler(this);
     _itemHandler          = new ItemHandler(this);
     _messageHandler       = new MessageHandler(this);
     _npcHandler           = new NpcHandler(this);
     _petHandler           = new PetHandler(this);
     _petNewHandler        = new PetNewHandler(this);
     _playerHandler        = new PlayerHandler(this);
     _prepaidHandler       = new PrepaidHandler(this);
     _resourceHandler      = new ResourceHandler(this);
     _skillHandler         = new SkillHandler(this);
     _skillKeysHandler     = new SkillKeysHandler(this);
     _taskHandler          = new TaskHandler(this);
     _teamHandler          = new TeamHandler(this);
     _entryHandler         = new EntryHandler(this);
     _roleHandler          = new RoleHandler(this);
 }
Example #13
0
 private void Start()
 {
     slowmotionClass                       = slowmotion.GetComponent <Slowmotion>();
     playerClass                           = player.GetComponent <Player>();
     playerActionsClass                    = player.GetComponent <PlayerActions>();
     coinsAcquiredOnScreenText             = coinsAcquired.GetComponent <TextMeshProUGUI>();
     coinsInScene                          = FindObjectsOfType <Coin>().Length;
     coinsAcquiredOnScreenText.text        = currentCoinsAcquired.ToString() + " / " + coinsInScene;
     playerStats                           = FindObjectOfType <PlayerStatistics>();
     taskHandler                           = FindObjectOfType <TaskHandler>();
     prevLowerBound                        = Camera.main.ViewportToWorldPoint(new Vector3(0, 0, 0)).y;
     playSpaceCollider                     = playSpace.GetComponent <PolygonCollider2D>();
     gameLinesClass                        = gameLines.GetComponent <GameLines>();
     levelCompletedText                    = levelCompletedTextGO.GetComponent <TextMeshProUGUI>();
     PersistentInformation.LevelIdentifier = gameObject.scene.name;
     pg = FindObjectOfType <ProceduralGeneration>();
     initialTimeForAdButtonAnimation = timeForAdButtonAnimation;
     adMobClass = FindObjectOfType <AdMob>();
     adMobClass.RequestRewardBasedVideo();
     adMobClass.RequestInterstitial();
 }
Example #14
0
        // This is different from the alias check as it's used in account creation before the user
        // as AuthenticatedData to talk to the web service with.
        public static Thread CheckUsernameAvailability(string username, TaskDelegate onCompleteDelegate)
        {
            if (string.IsNullOrEmpty(username))
            {
                onCompleteDelegate(CheckAliasResult.Unavailable);
                return(null);
            }

            return(TaskHandler.RunTask(delegate(object data)
            {
                var parameters = data as object[];
                var signal = parameters[0] as TaskDelegate;
                var targetUsername = parameters[1] as string;

                bool specified;
                CheckAliasResult result;

                try
                {
                    ServiceHandler.Service.IsAliasAvailable(targetUsername, out result, out specified);
                }
                catch (Exception error)
                {
                    specified = false;
                    result = CheckAliasResult.Unavailable;

                    Log.Write(error);
                }

                //Signal the calling threat that the operation is compete
                if (specified)
                {
                    onCompleteDelegate(result);
                }
                else
                {
                    onCompleteDelegate(CheckAliasResult.Unavailable);
                }
            }, onCompleteDelegate, username));
        }
        public void GetTask_Test()
        {
            Task tsk2 = new Task();

            tsk2.TaskName  = "testTask2";
            tsk2.StartDate = DateTime.Now;
            tsk2.EndDate   = DateTime.Now.AddDays(1);
            tsk2.Priority  = 10;
            tsk2.UserId    = 1;
            tsk2.ProjectId = 1;
            tsk2.TaskId    = 6;
            tsk2.ParentId  = 1;
            tsk2.User      = new User();
            tsk2.Project   = new Project();
            tsk2.Parent    = new ParentTask();
            Task tsk3 = new Task();

            tsk3.TaskName  = "testTask3";
            tsk3.StartDate = DateTime.Now;
            tsk3.EndDate   = DateTime.Now.AddDays(1);
            tsk3.Priority  = 10;
            tsk3.UserId    = 1;
            tsk3.ProjectId = 1;
            tsk3.TaskId    = 7;
            tsk3.ParentId  = 1;
            tsk3.User      = new User();
            tsk3.Project   = new Project();
            tsk3.Parent    = new ParentTask();

            var mockRepo = new Mock <ITaskRepository>();

            mockRepo.Setup(p => p.GetTaskById(6)).Returns(tsk2);
            var handler = new TaskHandler(mockRepo.Object);
            var tsk     = handler.GetTask(6);

            mockRepo.Verify(mock => mock.GetTaskById(6), Times.Once());
            Assert.AreEqual(tsk.TaskId, tsk2.TaskId);
            Assert.AreEqual(tsk.TaskName, tsk.TaskName);
        }
Example #16
0
 void Start()
 {
     foreach (Transform child in transform)
     {
         foreach (Transform particles in child)
         {
             playerParticles.Add(particles.gameObject);
             playerParticlesInitialScale.Add(particles.localScale);
         }
     }
     numParticles       = playerParticles.Count;
     moveSpeed          = 0.1f * runSpeed;
     playerRigidBody    = GetComponent <Rigidbody2D>();
     taskHandlerClass   = FindObjectOfType <TaskHandler>();
     playerState        = PlayerState.Still;
     vfxControllerClass = FindObjectOfType <VFXController>();
     if (levelController != null)
     {
         levelControllerClass = levelController.GetComponent <LevelController>();
     }
     playerStats = FindObjectOfType <PlayerStatistics>();
 }
Example #17
0
        protected override void OnActivate()
        {
            base.OnActivate();

            this.BladeFury   = this.Context.AbilityFactory.GetAbility <juggernaut_blade_fury>();
            this.HealingWard = this.Context.AbilityFactory.GetAbility <juggernaut_healing_ward>();
            this.Crit        = this.Context.AbilityFactory.GetAbility <juggernaut_blade_dance>();
            this.OmniSlash   = this.Context.AbilityFactory.GetAbility <juggernaut_omni_slash>();

            this.OmniBlinkHandler          = UpdateManager.Run(this.OnOmniBlink, false, false);
            this.HealingWardControlHandler = UpdateManager.Run(this.OnHealingWardControl, false, false);

            var factory = this.Menu.Hero.Factory;

            this.CritIndicator = factory.Item("Show Crit Indicator", true);
            this.CritIndicator.PropertyChanged += this.CritIndicatorPropertyChanged;
            this.OmniBlink = factory.Item("Blink while using Omnislash", true);
            this.OmniBlink.PropertyChanged += this.OmniBlinkOnPropertyChanged;
            this.ControlWard = factory.Item("Control Healing Ward", true);
            this.ControlWard.PropertyChanged += this.ControlWardPropertyChanged;
            this.BladeFuryMoveOnly            = factory.Item("Bladefury move only", true);

            Entity.OnInt32PropertyChange += this.OnNetworkActivity;
            if (this.CritIndicator)
            {
                this.Context.Renderer.Draw += this.OnDraw;
            }

            if (this.OmniBlink)
            {
                Unit.OnModifierAdded += this.OnOmniUsage;
            }

            if (this.ControlWard)
            {
                ObjectManager.OnAddEntity += this.OnHealingWardAdded;
            }
        }
Example #18
0
        public static void Main(string[] args)
        {
            string mode = System.Environment.GetEnvironmentVariable("APP_ENV");

            if (mode == null)
            {
                Console.WriteLine("APP_ENV not detected, defaulting to API instance.");
                mode = "api";
            }
            switch (mode)
            {
            case "worker":
                TaskReceiver receiver = new TaskReceiver();
                TaskHandler  worker   = new TaskHandler();
                receiver.StartConsumer(worker);
                break;

            case "api":
                Console.WriteLine("Starting API Mode.");
                CreateWebHostBuilder(args).Build().Run();
                break;
            }
        }
Example #19
0
        public void ApplyVote()
        {
            TaskHandler.RunTask(delegate(object data)
            {
                var parameters = data as object[];
                var selected   = parameters[0] as PollOption;

                try
                {
                    ServiceHandler.Service.ApplyVote(new PollData()
                    {
                        OptionId          = selected.Id,
                        OptionIdSpecified = true,
                    });

                    MainForm.SetStatusBar("Vote Response Sent.");
                }
                catch (Exception error)
                {
                    Log.Write(error);
                }
            }, this);
        }
Example #20
0
        protected override void OnActivate()
        {
            this.config = new SnatcherConfig();

            foreach (var blinkAbilityId in BlinkAbilityIds)
            {
                var ability = this.owner.GetAbilityById(blinkAbilityId);
                if (ability != null)
                {
                    try
                    {
                        this.blinkAbility = this.abilityFactory.Value.GetAbility <RangedAbility>(ability);
                        Log.Debug($"Snatcher: found ability for greed mode {this.blinkAbility}");
                    }
                    catch (AbilityNotImplementedException)
                    {
                        // not added to sdk yet
                    }
                }
            }

            this.onUpdateHandler = UpdateManager.Run(this.OnUpdate);
        }
Example #21
0
    void Update()
    {
        if (!playerStats.playerStatsLoaded)
        {
            playerStats = FindObjectOfType <PlayerStatistics>();
        }

        if (firstTimeLoad && playerStats.playerStatsLoaded)
        {
            InitializeChapterIconColors();
            UpdateFirstTaskOnScreen(false);
            UpdateSecondTaskOnScreen(false);
            numChapters = playerStats.chaptersList.Count;
            PersistentInformation.CurrentChapter = playerStats.highestChapter;
            chapterName.text = playerStats.chaptersList[PersistentInformation.CurrentChapter].ChapterName;
            UpdateIcons();
            firstTimeLoad = false;
        }

        if (taskHandlerClass == null)
        {
            taskHandlerClass = FindObjectOfType <TaskHandler>();
        }
    }
Example #22
0
    public static MultiTask TryGetIdleWalk(TaskHandler _taskHandler)
    {
        if (_taskHandler.CurrentMultiTask != null && _taskHandler.CurrentMultiTask.Priority >= PRIORITY_IDLEWALK)
        {
            return(null);
        }

        MultiTask _multiTask = new MultiTask(_taskHandler, PRIORITY_IDLEWALK);

        _multiTask.SetTasks(new Queue <Func <Task.State> >(new Func <Task.State>[] {
            () => {
                Node _currentNode = GameGrid.GetInstance().GetNodeFromWorldPos(_taskHandler.transform.position);
                Node _randomNode  = GameGrid.GetInstance().GetClosestFreeNode(GameGrid.GetInstance().GetRandomWalkableNode(_currentNode));

                _multiTask.taskFindPath.SetStartAndTarget(_currentNode, _randomNode);
                _multiTask.taskMoveAlongPath.SetSpeed(1.0f + (float)_multiTask.Priority);
                return(Task.State.Done);
            },
            () => _multiTask.taskFindPath.Perform(_multiTask),
            () => _multiTask.taskMoveAlongPath.Perform(_multiTask)
        }));

        return(_multiTask);
    }
Example #23
0
        private void commandBar1_DelCommandPressed(object sender, EventArgs e)
        {
            MyTask label = null;

            if (gridView1.FocusedRowHandle >= 0)
            {
                label = gridView1.GetRow(gridView1.FocusedRowHandle) as MyTask;
                if (label == null)
                {
                    return;
                }
            }


            try
            {
                if (XtraMessageBox.Show("Sicuro di voler procedere? ", "Elimina attività", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    Nested_CheckSecurityForDeletion();

                    TaskHandler h = new TaskHandler();
                    h.Delete(label);

                    IBindingList g = gridView1.DataSource as IBindingList;
                    g.Remove(label);
                }
            }
            catch (AccessDeniedException)
            {
                XtraMessageBox.Show("Impossibile accedere alla funzionalità richiesta. Accesso negato", "Errore", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            catch (Exception ex)
            {
                ErrorHandler.Show(ex);
            }
        }
Example #24
0
 public Task OnStopped(TaskHandler cb)
 {
     _onStoppedCb += cb;
     return(this);
 }
Example #25
0
 public Task OnResume(TaskHandler cb)
 {
     _onResumeCb += cb;
     return(this);
 }
Example #26
0
 public Task OnPause(TaskHandler cb)
 {
     _onPauseCb += cb;
     return(this);
 }
Example #27
0
 public Task OnStart(TaskHandler cb)
 {
     _onStartCb += cb;
     return(this);
 }
Example #28
0
 public SlarkCombo(Slark hero)
     : base(hero)
 {
     this.Slark       = hero;
     this.UltiHandler = UpdateManager.Run(this.OnUpdate);
 }
Example #29
0
 public void addTaskHandler(TaskHandler theHandler)
 {
     dataTaskHandler = theHandler;
     Verbose("Handler added.");
 }
Example #30
0
 public UpdaterTask(Dispatcher disp, TaskHandler handler, ClientConnectionList list, ObservableCollection<UserLocation> userLocations)
     : base(disp, handler)
 {
     ClientConnectionList = list;
     UserLocations = userLocations;
 }
Example #31
0
 public void AddHandler(Type messageType, TaskHandler handler, int allowedPhase)
 {
     //if (allowedPhase >= 0)
         //handlers.Add(messageType, new TaskHandlerDescriptor(handler, allowedPhase));
 }
Example #32
0
 private void RecycleTaskHandler(TaskHandler handler)
 {
     pool.Add(handler);
     creatCount--;
 }
Example #33
0
 public void addTaskHandler(TaskHandler theHandler)
 {
     userTaskHandler = theHandler;
     Verbose("Handler added");
 }
        public void ThreadSafeDictionary_Add_MultiThread(int n_tasks, int elements_pertask)
        {
            ThreadSafeDictionary <int, int> list = new ThreadSafeDictionary <int, int>();

            TaskSet <int> ts = new TaskSet <int>();

            ts.Task = new Action <int>((t) =>
            {
                for (int i = 0; i < elements_pertask; i++)
                {
                    list.Add(elements_pertask * t + i, i);
                }
            });

            List <Task> tasks = new List <Task>();

            for (int t = 0; t < n_tasks; t++)
            {
                tasks.Add(TaskHandler.StartNew(ts, t));
            }

            bool running = true;
            int  cycle   = 1;

            while (running)
            {
                int keys   = 0;
                int values = 0;
                foreach (int i in list.Keys) // if any error encountered in the enumerator access, this is not threadsafe
                {
                    keys++;
                }

                foreach (int i in list.Values) // if any error encountered in the enumerator access, this is not threadsafe
                {
                    values++;
                }

                Console.WriteLine("Cycle {0}: {1} keys, {2} values".F(cycle, keys, values));
                cycle++;

                running = false;
                foreach (Task tk in tasks)
                {
                    if (!tk.IsCompleted)
                    {
                        running = true;
                        break;
                    }
                }
            }

            Assert.Multiple(() =>
            {
                Assert.That(list.Count, Is.EqualTo(n_tasks * elements_pertask));

                int[] elements = new int[elements_pertask];
                foreach (int i in list.Values)
                {
                    elements[i]++;
                }

                foreach (int element_count in elements)
                {
                    Assert.That(element_count, Is.EqualTo(n_tasks));
                }
            });
        }
        public static void StartAllegiance(string ticket, LobbyType lobbyType, string alias, TaskDelegate onCompleteDelegate)
        {
            DebugDetector.AssertCheckRunning();

            TaskHandler.RunTask(delegate(object p)
            {
                var param         = p as object[];
                var sessionTicket = param[0] as string;
                var signal        = param[1] as TaskDelegate;
                var succeeded     = false;

                try
                {
                    AllegianceRegistry.OutputDebugString = DataStore.Preferences.DebugLog;
                    AllegianceRegistry.LogToFile         = DataStore.Preferences.DebugLog;
                    AllegianceRegistry.LogChat           = DataStore.Preferences.LogChat;

                    //Create commandline
                    var commandLine = new StringBuilder("-authenticated")
                                      .AppendFormat(" -callsign={0}", alias);

                    if (DataStore.Preferences.DebugLog)
                    {
                        commandLine.Append(" -debug");
                    }

                    if (DataStore.Preferences.LaunchWindowed)
                    {
                        commandLine.Append(" -windowed");
                    }

                    if (DataStore.Preferences.NoMovies)
                    {
                        commandLine.Append(" -nomovies");
                    }

                    //Start Allegiance
                    string lobbyPath = Path.Combine(AllegianceRegistry.LobbyPath, lobbyType.ToString());

                    string allegiancePath = Path.Combine(lobbyPath, "Allegiance.exe");

                    if (DataStore.Preferences.UseDX7Engine == true)
                    {
                        allegiancePath = Path.Combine(lobbyPath, "AllegianceDX7.exe");
                    }


#if DEBUG
                    if (String.IsNullOrEmpty(ConfigurationManager.AppSettings["AllegianceExeOverride"]) == false)
                    {
                        Log.Write("Allegiance path was overridden by configuration setting.");
                        allegiancePath = ConfigurationManager.AppSettings["AllegianceExeOverride"];
                    }
#endif

                    Log.Write("Using: " + allegiancePath + " " + commandLine.ToString() + " to launch...");

                    ProcessHandler process = ProcessHandler.Start(allegiancePath, commandLine.ToString());

                    process.OnExiting += new EventHandler(process_OnExiting);

                    _allegianceProcess        = process;
                    _allegianceProcessMonitor = new ProcessMonitor(_allegianceProcess);

                    // If launching into a lobby, then relay the security token to the allegiance process.
                    if (lobbyType != LobbyType.None)
                    {
                        //Open Pipe
                        using (var reset = new ManualResetEvent(false))
                        {
                            TaskHandler.RunTask(delegate(object value)
                            {
                                var parameters          = value as object[];
                                var localProcessHandler = parameters[0] as ProcessHandler;
                                var localSessionTicket  = parameters[1] as String;
                                var localReset          = parameters[2] as ManualResetEvent;

                                using (var pipe = new Pipe(@"\\.\pipe\allegqueue"))
                                {
                                    pipe.Create();

                                    if (pipe.Connect())
                                    {
                                        Int64 memoryLocation = Int64.Parse(pipe.Read());

                                        localProcessHandler.WriteMemory(memoryLocation, localSessionTicket + (char)0x00 + Process.GetCurrentProcess().Id);

                                        localReset.Set();
                                    }
                                }
                            }, process, sessionTicket, reset);


                            //Wait X seconds, if allegiance does not retrieve the ticket, exit Allegiance.
                            if (!reset.WaitOne(PipeTimeout))
                            {
                                try
                                {
                                    process.ForceClose();

                                    //Connect to the pipe in order to close out the connector thread.
                                    using (var pipe = new Pipe(@"\\.\pipe\allegqueue"))
                                    {
                                        pipe.OpenExisting();
                                        pipe.Read();
                                    }
                                }
                                catch { }
                                finally
                                {
                                    throw new Exception("Allegiance did not respond within the time allotted.");
                                }
                            }

                            // The memory address was retrived from the pipe, write the ticket onto the target process.
                            //process.WriteMemory((Int64) memoryLocation, sessionTicket);
                        }
                    }

                    succeeded = true;
                }
                catch (Exception error)
                {
                    Log.Write(error);
                }
                finally
                {
                    signal(succeeded);
                }
            }, ticket, onCompleteDelegate);
        }
Example #36
0
 public GenericHeroCombo(GenericHero hero)
     : base(hero)
 {
     this.GenericHero     = hero;
     this.EulComboHandler = UpdateManager.Run(EulCombo);
 }
Example #37
0
 public TaskHandlerDescriptor(TaskHandler taskHandler, int allowedPhase)
 {
     pTaskHandler = taskHandler;
     pAllowedPhase = allowedPhase;
 }
Example #38
0
 public DrowRangerCombo(DrowRanger hero)
     : base(hero)
 {
     this.DrowRanger   = hero;
     this.ArrowHandler = UpdateManager.Run(this.OnUpdate);
 }
 public AddClientToUserListTask(Dispatcher disp, TaskHandler handler, ClientConnectionList list, ClientConnection client)
     : base(disp, handler)
 {
     ClientConnectionList = list;
     ClientConnection = client;
 }