public CommandContextBuilder(
     IOpenModStringLocalizer stringLocalizer,
     ILifetimeScope lifetimeScope)
 {
     m_StringLocalizer = stringLocalizer;
     m_LifetimeScope   = lifetimeScope;
 }
예제 #2
0
 public CommandEventListener(
     ICommandCooldownStore commandCooldownStore,
     IOpenModStringLocalizer stringLocalizer)
 {
     m_CommandCooldownStore = commandCooldownStore;
     m_StringLocalizer      = stringLocalizer;
 }
예제 #3
0
 public CommandOpenModUpdate(
     IConfiguration configuration,
     IOpenModStringLocalizer stringLocalizer,
     IServiceProvider serviceProvider, NuGetPluginAssembliesSource nuGetPlugins) : base(serviceProvider)
 {
     m_Configuration   = configuration;
     m_StringLocalizer = stringLocalizer;
     m_NuGetPlugins    = nuGetPlugins;
 }
예제 #4
0
 public RocketModCommandEventListener(
     IOpenModUnturnedConfiguration configuration,
     ICommandCooldownStore commandCooldownStore,
     IOpenModStringLocalizer stringLocalizer)
 {
     m_Configuration        = configuration;
     m_CommandCooldownStore = commandCooldownStore;
     m_StringLocalizer      = stringLocalizer;
 }
예제 #5
0
 public CommandHelp(
     IPermissionChecker permissionChecker,
     ICommandStore commandStore,
     IServiceProvider serviceProvider,
     ICommandPermissionBuilder commandPermissionBuilder,
     ICommandContextBuilder commandContextBuilder,
     IOpenModStringLocalizer stringLocalizer) : base(serviceProvider)
 {
     m_PermissionChecker        = permissionChecker;
     m_CommandStore             = commandStore;
     m_CommandPermissionBuilder = commandPermissionBuilder;
     m_CommandContextBuilder    = commandContextBuilder;
     m_StringLocalizer          = stringLocalizer;
 }
예제 #6
0
        public CommandHelp(
            IRuntime runtime,
            ICommandStore commandStore,
            IServiceProvider serviceProvider,
            IPermissionRegistry permissionRegistry,
            ICommandPermissionBuilder commandPermissionBuilder,
            ICommandContextBuilder commandContextBuilder,
            IOpenModStringLocalizer stringLocalizer) : base(serviceProvider)
        {
            // get global permission checker instead of scoped
            m_PermissionChecker = runtime.Host !.Services.GetRequiredService <IPermissionChecker>();

            m_CommandStore             = commandStore;
            m_PermissionRegistry       = permissionRegistry;
            m_CommandPermissionBuilder = commandPermissionBuilder;
            m_CommandContextBuilder    = commandContextBuilder;
            m_StringLocalizer          = stringLocalizer;
        }
예제 #7
0
        public UnturnedUserProvider(
            IEventBus eventBus,
            IOpenModStringLocalizer stringLocalizer,
            IUserDataSeeder dataSeeder,
            IUserDataStore userDataStore,
            IRuntime runtime)
        {
            m_EventBus        = eventBus;
            m_DataSeeder      = dataSeeder;
            m_StringLocalizer = stringLocalizer;
            m_UserDataStore   = userDataStore;
            m_Runtime         = runtime;
            m_Users           = new HashSet <UnturnedUser>();
            m_PendingUsers    = new HashSet <UnturnedPendingUser>();

            // sync users in case of openmod reloads
            if (Provider.clients != null)
            {
                foreach (var client in Provider.clients)
                {
                    m_Users.Add(new UnturnedUser(this, userDataStore, client.player));
                }
            }

            if (Provider.pending != null)
            {
                foreach (var pending in Provider.pending)
                {
                    m_PendingUsers.Add(new UnturnedPendingUser(this, userDataStore, pending));
                }
            }

            Provider.onCheckValidWithExplanation += OnPendingPlayerConnecting;
            Provider.onServerConnected           += OnPlayerConnected;
            Provider.onServerDisconnected        += OnPlayerDisconnected;
            Provider.onRejectingPlayer           += OnRejectingPlayer;
        }
예제 #8
0
 public OfflineUserProvider(IOpenModStringLocalizer stringLocalizer, IUserDataStore userDataStore)
 {
     m_StringLocalizer = stringLocalizer;
     m_UserDataStore   = userDataStore;
 }
예제 #9
0
 public CommandParameters(CommandContext commandContext, ICollection <string> args)
 {
     m_OpenModStringLocalizer = commandContext.ServiceProvider.GetRequiredService <IOpenModStringLocalizer>();
     m_ServiceProvider        = commandContext.ServiceProvider;
     RawParameters            = args;
 }
 public TypeDescriptorCommandParameterResolveProvider(IServiceProvider serviceProvider, IOpenModStringLocalizer openModStringLocalizer)
 {
     m_ServiceProvider        = serviceProvider;
     m_OpenModStringLocalizer = openModStringLocalizer;
 }
 public NotEnoughPermissionException(IOpenModStringLocalizer stringLocalizer, string permission)
     : base(stringLocalizer["commands:errors:not_enough_permission", new { Permission = permission }])
 {
 }
예제 #12
0
 public CommandWrongUsageException(ICommandContext context, IOpenModStringLocalizer localizer)
     : base(localizer["commands:errors:wrong_usage", new { Command = context.CommandPrefix + context.CommandAlias, Args = string.Join(" ", context.Parameters), context.CommandRegistration !.Syntax }])