Ejemplo n.º 1
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);
        }
Ejemplo n.º 2
0
 public override void Resolve(string parameter = "")
 {
     CommandOutputEvent.Call(Command, ErrorMessage);
 }
Ejemplo n.º 3
0
 protected void Output(string message)
 {
     CommandOutputEvent.Call(this.DisplayName, message);
 }