Exemplo n.º 1
0
        public TestModule(API api, ICommandHandler commandHandler, IVehicleHandler vehicleHandler,
                          IMessageHandler messageHandler, IClientWrapper clientWrapper, IWeaponUtils weaponUtils, IClientHandler clientHandler)
        {
            LoginFucker         = new LoginFucker(api, messageHandler, clientWrapper);
            CommandHelp         = new CommandHelp(api, commandHandler, messageHandler);
            ExtendedVehicleTest = new ExtendedVehicleTest(vehicleHandler, messageHandler);

            VehicleCommands   = new VehicleCommands(api, vehicleHandler);
            ClientWrapperTest = new ClientWrapperTest(api, clientWrapper, messageHandler);
            WeaponCommands    = new WeaponCommands(api, weaponUtils, messageHandler);
            UserCommands      = new UserCommands(api, clientHandler, messageHandler, clientWrapper);
        }
Exemplo n.º 2
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));
        }