예제 #1
0
        public override async Task Started()
        {
            this.config = await this.Rpc.Event(DebugEvents.Configuration).Request <Configuration>();

            this.activateKey = (Control)Enum.Parse(typeof(Control), this.config.ActivateKey, true);

            this.Logger.Debug($"Activate key set to {this.config.ActivateKey}");

            this.Rpc.Event(DebugEvents.Configuration).On <Configuration>((e, c) =>
            {
                this.config      = c;
                this.activateKey = (Control)Enum.Parse(typeof(Control), this.config.ActivateKey, true);
            });

            this.Commands.Register("ipl-load", a => IplCommands.Load(this.Logger, a));
            this.Commands.Register("ipl-unload", a => IplCommands.Unload(this.Logger, a));
            this.Commands.Register("inv", a => PlayerCommands.Invincible(this.Logger, a.ToList()));
            this.Commands.Register("veh", a => VehicleCommands.Spawn(this.Logger, a.ToList()));

            this.Ticks.Attach(new Action(Tick));
        }