private static void Load()
        {
            foreach (MyObjectBuilder_Checkpoint.ModItem mod in MyAPIGateway.Session.Mods)
            {
                if (mod.PublishedFileId == 1286147283uL || mod.Name == "ARMS")
                {
                    Logger.DebugLog("ARMS mod: FriendlyName: " + mod.FriendlyName + ", Name: " + mod.Name + ", Published ID: " + mod.PublishedFileId);
                    MySessionComponentBase component = Mods.FindModSessionComponent(mod.Name, "SteamShipped", "SteamShipped.Notify");
                    if (component == null)
                    {
                        Logger.AlwaysLog($"Failed to find Session Component.", Logger.severity.ERROR);
                        return;
                    }
                    component.GetType().GetField("HasNotified").SetValue(component, true);
                    return;
                }
            }

            Logger.AlwaysLog("Failed to find mod", Logger.severity.ERROR);
            return;
        }
Exemplo n.º 2
0
        private static void SessionComponentEntry(MySessionComponentBase component, ref MultiProfilerEntry mpe)
        {
            if (_activeProfilers == 0)
            {
                return;
            }

            if (_modMask != null && component.ModContext != _modMask)
            {
                return;
            }

            if (_activeProfilersByType[(int)ProfilerRequestType.Mod] > 0)
            {
                var modContext = ModLookupUtils.GetMod(component) ?? MyModContext.BaseGame;
                mpe.Add(PerfMod.GetOrAdd(modContext, DelMakeMod));
            }

            if (_activeProfilersByType[(int)ProfilerRequestType.Session] > 0)
            {
                mpe.Add(PerfSessionComponent.GetOrAdd(component.GetType(), DelMakeSessionComponent));
            }
        }