public ClipboardService(Action<ClipboardDataItem> notificationCallback) { _form = new NotificationForm(this); NativeMethods.SetParent(_form.Handle, NativeMethods.HWND_MESSAGE); _notificationCallback = notificationCallback; _clipboardUpdateActionScheduler = new ActionScheduler<ClipboardDataItem>(TimeSpan.FromMilliseconds(SCHEDULER_RESOLUTION)); }
public async Task Execute(ActionScheduler scheduler) { // Send message to chat.so await scheduler.CreateMessageAsync(_message); // Send message to Discord var config = Manager.Config(); var channelName = config.StackToDiscordMap[scheduler.RoomId]; var discordClient = await Discord.GetDiscord(); var discord = discordClient.GetChannel(config.DiscordChannelNamesToIds[channelName]); if (discord is SocketTextChannel textChannel) { if (_markdownMessage != null) { await textChannel.SendMessageAsync($"{_markdownMessage}"); } else { await textChannel.SendMessageAsync($"```{_message}```"); } } }
public void ActionScheduler_ReportsExceptionWithGlobalMetricHandler() { Exception x = null; var tcs = new TaskCompletionSource <bool>(); Metric.Config.WithErrorHandler(e => { x = e; tcs.SetResult(true); }); using (ActionScheduler scheduler = new ActionScheduler()) { scheduler.Start(TimeSpan.FromMilliseconds(10), t => { throw new InvalidOperationException("boom"); }); tcs.Task.Wait(1000); scheduler.Stop(); } x.Should().NotBeNull(); }
private void Start() { mover = GetComponent <Mover>(); actionScheduler = GetComponent <ActionScheduler>(); animator = GetComponent <Animator>(); }
// Start is called before the first frame update void Start() { ai = GetComponent <IAstarAI>(); actionScheduler = GetComponent <ActionScheduler>(); animator = GetComponentInChildren <Animator>(); }
protected virtual void AwaitersFinish() { Debug.LogWarning("WIP"); ActionScheduler.AddAction(() => loadingScreen.SetActive(false)); }
protected virtual void Start() { _animator = GetComponentInChildren <Animator>(); _actionScheduler = GetComponent <ActionScheduler>(); _actor = GetComponent <Actor>(); }
///////////////////////////// PRIVATE METHODS //////////////////////////////////////////// private void Awake() { m_NMA = GetComponent <NavMeshAgent>(); m_ActionScheduler = GetComponent <ActionScheduler>(); m_Health = GetComponent <Health>(); }
void Start() { animator = GetComponentInChildren <Animator>(); mover = GetComponent <Mover>(); actionScheduler = GetComponent <ActionScheduler>(); }
private void Start() { characterMover = GetComponent <CharacterMover>(); actionScheduler = GetComponent <ActionScheduler>(); }
private void Awake() { actionScheduler = GameObject.Find("Player").GetComponent <ActionScheduler>(); pc = GameObject.Find("Player").GetComponent <PlayerController>(); }
private void Awake() { _actionScheduler = GetComponent <ActionScheduler>(); _animator = GetComponent <Animator>(); _mover = GetComponent <Mover>(); }
private void Start() { this.mover = this.GetComponent <Mover>(); this.actionScheduler = this.GetComponent <ActionScheduler>(); this.animator = GetComponent <Animator>(); }
void Start() { _mover = GetComponent <Mover>(); _actionScheduler = GetComponent <ActionScheduler>(); _animator = GetComponent <Animator>(); }
private static bool HackingTool__AbortHack__Prefix(HackingTool __instance) { if (!__instance.m_isHacking) { return(HarmonyControlFlow.Execute); } // Execute the rest of the hacking sequence if interrupted // prematurely. switch (__instance.m_state) { case HackingTool.HackSequenceState.UpdateMiniGame: var timingGrid = __instance.m_activeMinigame.TryCast <HackingMinigame_TimingGrid>(); // Skip the TimingGrid's GamePauseTimer as it only updates // its state every so often. if (timingGrid?.m_puzzleDone != true) { return(HarmonyControlFlow.Execute); } __instance.Sound.Post(EVENTS.HACKING_PUZZLE_SUCCESS); CompleteHack(1); return(HarmonyControlFlow.DontExecute); case HackingTool.HackSequenceState.DoneWait: CompleteHack(1); return(HarmonyControlFlow.DontExecute); case HackingTool.HackSequenceState.Done: CompleteHack(); return(HarmonyControlFlow.DontExecute); default: return(HarmonyControlFlow.Execute); } void CompleteHack(float?delay = null) { var hackable = __instance.m_currentHackable; var sound = __instance.Sound; var player = __instance.Owner; __instance.ClearScreen(); __instance.m_activeMinigame?.EndGame(); __instance.OnStopHacking(); __instance.m_state = HackingTool.HackSequenceState.Idle; __instance.m_stateTimer = 0; __instance.m_currentHackable = null; if (delay == null) { Impl(); return; } ActionScheduler.Schedule(Impl, (float)delay); void Impl() { sound.Post(EVENTS.BUTTONGENERICSEQUENCEFINISHED); if (hackable == null) { return; } LG_LevelInteractionManager.WantToSetHackableStatus(hackable, eHackableStatus.Success, player); } } }
private void Awake() { scheduler = GetComponent <ActionScheduler>(); mover = GetComponent <Mover>(); }
private void Awake() { actions = new List <Action>(); Instance = this; }
void Start() { agent = GetComponent <NavMeshAgent>(); myAnimator = GetComponent <Animator>(); actionScheduler = GetComponent <ActionScheduler>(); }
private void Awake() { _scheduler = GetComponent <ActionScheduler>(); maxHealth = GetComponent <BaseStats>().GetHealth(); currentHealth = maxHealth; }
void Start() { actionScheduler = GetComponent <ActionScheduler>().Register(this); moveService = GetComponent <MovementService>(); }
// Start is called before the first frame update void Start() { navMeshAgent = GetComponent <NavMeshAgent>(); actionScheduler = GetComponent <ActionScheduler>(); }
private void Start() { navMeshAgent = GetComponent <NavMeshAgent>(); actionScheduler = GetComponent <ActionScheduler>(); health = GetComponent <Health>(); }
public HealthControllerBehaviour(float healthRegenerationOnLevelUp, Animator anim, ActionScheduler actionScheduler, Collider[] colliders, MonoBehaviour[] components, IBaseStats stat) { _healthRegenerationOnLevelUp = healthRegenerationOnLevelUp; _anim = anim; _actionScheduler = actionScheduler; _colliders = colliders; _components = components; _stat = stat; }
void Start() { mover = GetComponent <Mover>(); actionScheduler = GetComponent <ActionScheduler>(); }
static void Main(string[] args) { var connectionString = AppSettingsManager.GetConnectionString(); AppDomain.CurrentDomain.SetData("DataDirectory", Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location)); SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder(connectionString); Console.Title = "FifaAutobuyer // " + AppSettingsManager.GetInstanceDescription() + " // Path: " + Path.GetFileName(Environment.CurrentDirectory) + " // Port: " + AppSettingsManager.GetWebappPort(); Console.WriteLine("Connectionstring: " + connectionString); Console.WriteLine(); Console.WriteLine("Description: " + AppSettingsManager.GetInstanceDescription()); Console.WriteLine("Create Database if not exists..."); DatabaseScheduler.CreateDatabaseIfNotExists(); using (var ctx = new FUTCreationDatabase()) { if (!ctx.WebpanelAccounts.Any()) { ctx.WebpanelAccounts.Add(new WebpanelAccount() { Username = "******", Password = "******", Role = WebAccessRole.Administrator }); ctx.WebpanelAccounts.Add(new WebpanelAccount() { Username = "******", Password = "******", Role = WebAccessRole.Moderator }); } ctx.SaveChanges(); } Console.WriteLine("Updating Settings..."); ProxyManager.Initialize(); Console.WriteLine("Updating Players and Consumables..."); EADatabaseScraper.UpdateAsync().Wait(); FUTItemManager.LoadItems(); Console.WriteLine("Initializing BotManager..."); BotManager.Initialize(); Console.WriteLine("Initializing ActionScheduler..."); ActionScheduler.CreateScheduler(); Console.WriteLine("Resetting PriceChecks..."); ItemListManager.ResetPriceCheckEverywhere(); Console.WriteLine("Initializing MailService..."); MailClientFactory.Initialize(); Console.WriteLine("Initializing HttpServer..."); HttpWebServer.Start(AppSettingsManager.GetWebappPort()); Console.WriteLine("AntiCaptcha: " + AppSettingsManager.GetAntiCaptchaKey()); Console.WriteLine("HttpServer hosted on port " + AppSettingsManager.GetWebappPort()); Console.WriteLine("Ready..."); //var dbScheudulerDeleteOldTrades = new Timer((e) => // { // AuctionManager.RemoveOldAuctions(); // }, null, 0, (long)TimeSpan.FromHours(1).TotalMilliseconds); //var dbScheudulerSaveBotStatistics = new Timer((e) => //{ // DatabaseScheduler.SaveBotStatistics(); //}, null, 0, (long)TimeSpan.FromMinutes(30).TotalMilliseconds); //var dbScheudulerDeleteOldLogs = new Timer((e) => //{ // DatabaseScheduler.DeleteOldLogs(); //}, null, 0, (long)TimeSpan.FromMinutes(30).TotalMilliseconds); while (true) { var command = Console.ReadLine(); if (command == "exit") { Environment.Exit(0); } } }
public CommandRouter(IRoomService roomService, ICommandStore commandService, IHttpService httpService, int roomId, ActionScheduler actionScheduler) { _priorityProcessor = new PriorityProcessor(roomService, commandService, httpService, roomId); _actionScheduler = actionScheduler; // Populate these with dynamic commands (from a db or something) once that is a thing _processors = Array.Empty <ICommandProcessor>(); }
private void Awake() { _characterController = GetComponent <CharacterController>(); _actionScheduler = GetComponent <ActionScheduler>(); }
// Start is called before the first frame update private void Awake() { _navMeshAgent = GetComponent <NavMeshAgent>(); _animator = GetComponent <Animator>(); _actionScheduler = GetComponent <ActionScheduler>(); }
private void Awake() { _enemiesInFOV = new List <GameObject>(); _actionScheduler = GetComponent <ActionScheduler>(); _animator = GetComponent <Animator>(); }