コード例 #1
0
    private void _on_Button_pressed()
    {
        if (Text == "" || Text.Empty())
        {
            return;
        }
        RichTextLabel node = GetParent().GetParent().GetParent().GetNode <RichTextLabel>("CommandPanel/RichTextLabel");

        node.Text += $">{GetText()}\n";
        CommandInputEvent.Call(GetText());
        LastCmds.Add(GetText());
        currentCmd = 0;
        SetText("");
    }
コード例 #2
0
        public Listener(ICollection <Command> commands, int port)
        {
            Commands = new List <Command>(commands);

            /*ServicePointManager.ServerCertificateValidationCallback +=
             *  (sender, certificate, chain, sslPolicyErrors) => true;*/
            connection = new HubConnectionBuilder().WithUrl($"http://localhost:{port}/MiniLyokoHub").Build();

            StartConnection();
            connection.Closed += async(error) =>
            {
                await Task.Delay(new Random().Next(0, 5) * 1000);

                await connection.StartAsync();
            };

            TowerActivationEvent.Subscribe(OnTowerActivation);
            TowerDeactivationEvent.Subscribe(OnTowerDeactivation);
            TowerHijackEvent.Subscribe(OnTowerHijack);
            CommandOutputEvent.Subscribe(OnCommandOutput);
            LyokoLogger.Subscribe(OnLogger);
            CommandInputEvent.Subscribe(OnCommand);
        }
コード例 #3
0
 private void OnSignalRCommand(string command)
 {
     CommandInputEvent.Call(command);
 }