public AutoHangar(Hangar PluginInstance, GridTracker gridTracker, GridMarket Market = null)
        {
            Plugin  = PluginInstance;
            Tracker = gridTracker;

            if (Market != null)
            {
                Servers = Market.MarketServers;
            }
        }
Exemple #2
0
        public void Apply(PatchContext ctx, Hangar plugin)
        {
            var SaveMethod = typeof(MySession).GetMethod("Save", BindingFlags.Public | BindingFlags.Instance, null,
                                                         new Type[] { typeof(MySessionSnapshot).MakeByRefType(), typeof(string) }, null);

            if (SaveMethod == null)
            {
                throw new InvalidOperationException("Couldn't find Save");
            }
            ctx.GetPattern(SaveMethod).Suffixes.Add(Method(nameof(AfterSave)));
            Plugin  = plugin;
            Tracker = plugin.Tracker;
        }