Exemplo n.º 1
0
        public void RegisterPluginCommands(ITorchPlugin plugin)
        {
            var assembly = plugin.GetType().Assembly;

            foreach (var type in assembly.ExportedTypes)
            {
                RegisterCommandModule(type, plugin);
            }
        }
Exemplo n.º 2
0
        private void DoInit()
        {
            PluginManager.Plugins.TryGetValue(new Guid("b1307cc4-e307-4ec5-a0e0-732a624abfcc"), out DPBPlugin);

            DPBCanAdd = DPBPlugin?.GetType()
                        .GetMethod("CanProject", BindingFlags.Public | BindingFlags.Static);
            DPBInstalled = DPBCanAdd != null;

            _limitHandlers = new List <ProcessHandlerBase>
            {
                new Annoy(),
                new Punish()
            };
            _processThreads = new List <Thread>();
            _processThread  = new Thread(PluginProcessing);
            _processThread.Start();

            MyMultiplayer.Static.ClientJoined             += StaticOnClientJoined;
            MyCubeGrids.BlockBuilt                        += MyCubeGridsOnBlockBuilt;
            MySession.Static.Factions.FactionStateChanged += FactionsOnFactionStateChanged;
            MySession.Static.Factions.FactionCreated      += FactionsOnFactionCreated;
            MyEntities.OnEntityAdd                        += MyEntitiesOnOnEntityAdd;
        }
Exemplo n.º 3
0
 private static Type DeclareInstalledPlugin(ITorchPlugin Plugin)
 {
     Log.Info("Plugin: " + Plugin.Name + " " + Plugin.Version + " is installed!");
     return(Plugin.GetType());
 }