コード例 #1
0
 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));
 }
コード例 #2
0
        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}```");
                }
            }
        }
コード例 #3
0
        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();
        }
コード例 #4
0
ファイル: Fighter.cs プロジェクト: zeatful/RPG
 private void Start()
 {
     mover           = GetComponent <Mover>();
     actionScheduler = GetComponent <ActionScheduler>();
     animator        = GetComponent <Animator>();
 }
コード例 #5
0
 // Start is called before the first frame update
 void Start()
 {
     ai = GetComponent <IAstarAI>();
     actionScheduler = GetComponent <ActionScheduler>();
     animator        = GetComponentInChildren <Animator>();
 }
コード例 #6
0
 protected virtual void AwaitersFinish()
 {
     Debug.LogWarning("WIP");
     ActionScheduler.AddAction(() => loadingScreen.SetActive(false));
 }
コード例 #7
0
 protected virtual void Start()
 {
     _animator        = GetComponentInChildren <Animator>();
     _actionScheduler = GetComponent <ActionScheduler>();
     _actor           = GetComponent <Actor>();
 }
コード例 #8
0
        ///////////////////////////// PRIVATE METHODS ////////////////////////////////////////////


        private void Awake()
        {
            m_NMA             = GetComponent <NavMeshAgent>();
            m_ActionScheduler = GetComponent <ActionScheduler>();
            m_Health          = GetComponent <Health>();
        }
コード例 #9
0
 void Start()
 {
     animator        = GetComponentInChildren <Animator>();
     mover           = GetComponent <Mover>();
     actionScheduler = GetComponent <ActionScheduler>();
 }
コード例 #10
0
ファイル: Fighter.cs プロジェクト: mikxingu/IslandEscape
 private void Start()
 {
     characterMover  = GetComponent <CharacterMover>();
     actionScheduler = GetComponent <ActionScheduler>();
 }
コード例 #11
0
 private void Awake()
 {
     actionScheduler = GameObject.Find("Player").GetComponent <ActionScheduler>();
     pc = GameObject.Find("Player").GetComponent <PlayerController>();
 }
コード例 #12
0
 private void Awake()
 {
     _actionScheduler = GetComponent <ActionScheduler>();
     _animator        = GetComponent <Animator>();
     _mover           = GetComponent <Mover>();
 }
コード例 #13
0
 private void Start()
 {
     this.mover           = this.GetComponent <Mover>();
     this.actionScheduler = this.GetComponent <ActionScheduler>();
     this.animator        = GetComponent <Animator>();
 }
コード例 #14
0
 void Start()
 {
     _mover           = GetComponent <Mover>();
     _actionScheduler = GetComponent <ActionScheduler>();
     _animator        = GetComponent <Animator>();
 }
コード例 #15
0
ファイル: HackingTool.cs プロジェクト: notpeelz/GTFO-QoLFix
        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);
                }
            }
        }
コード例 #16
0
ファイル: Interacter.cs プロジェクト: NiclasMart/RPGPrototype
 private void Awake()
 {
     scheduler = GetComponent <ActionScheduler>();
     mover     = GetComponent <Mover>();
 }
コード例 #17
0
 private void Awake()
 {
     actions  = new List <Action>();
     Instance = this;
 }
コード例 #18
0
ファイル: Mover.cs プロジェクト: ipevr/RPG2
 void Start()
 {
     agent           = GetComponent <NavMeshAgent>();
     myAnimator      = GetComponent <Animator>();
     actionScheduler = GetComponent <ActionScheduler>();
 }
コード例 #19
0
ファイル: Health.cs プロジェクト: WayneDelinquent/RPGDemo
 private void Awake()
 {
     _scheduler    = GetComponent <ActionScheduler>();
     maxHealth     = GetComponent <BaseStats>().GetHealth();
     currentHealth = maxHealth;
 }
コード例 #20
0
 void Start()
 {
     actionScheduler = GetComponent <ActionScheduler>().Register(this);
     moveService     = GetComponent <MovementService>();
 }
コード例 #21
0
 // Start is called before the first frame update
 void Start()
 {
     navMeshAgent    = GetComponent <NavMeshAgent>();
     actionScheduler = GetComponent <ActionScheduler>();
 }
コード例 #22
0
ファイル: Mover.cs プロジェクト: cvhnilicka/RPGPractice
 private void Start()
 {
     navMeshAgent    = GetComponent <NavMeshAgent>();
     actionScheduler = GetComponent <ActionScheduler>();
     health          = GetComponent <Health>();
 }
コード例 #23
0
 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;
 }
コード例 #24
0
ファイル: Fighter.cs プロジェクト: ipevr/RPG2
 void Start()
 {
     mover           = GetComponent <Mover>();
     actionScheduler = GetComponent <ActionScheduler>();
 }
コード例 #25
0
ファイル: Program.cs プロジェクト: WakaToa/FifaAutobuyer
        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);
                }
            }
        }
コード例 #26
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>();
        }
コード例 #27
0
ファイル: BasicMovement.cs プロジェクト: SROPPE/Lumberjack
 private void Awake()
 {
     _characterController = GetComponent <CharacterController>();
     _actionScheduler     = GetComponent <ActionScheduler>();
 }
コード例 #28
0
ファイル: Mover.cs プロジェクト: arthurgonze/Core-RPG-System
 // Start is called before the first frame update
 private void Awake()
 {
     _navMeshAgent    = GetComponent <NavMeshAgent>();
     _animator        = GetComponent <Animator>();
     _actionScheduler = GetComponent <ActionScheduler>();
 }
コード例 #29
0
ファイル: Fighter.cs プロジェクト: SROPPE/Lumberjack
 private void Awake()
 {
     _enemiesInFOV    = new List <GameObject>();
     _actionScheduler = GetComponent <ActionScheduler>();
     _animator        = GetComponent <Animator>();
 }