Example #1
0
        /// <summary>
        /// Register packet monitoring, not necessary if you don't want the local machine to handle incomming packets.
        /// </summary>
        public void Register(IMyModContext mod)
        {
            Mod = mod;
            MyAPIGateway.Multiplayer.RegisterSecureMessageHandler(ChannelId, ReceivedPacket);

            LogInfo      = LogInfo ?? MyLog.Default.WriteLine;
            LogError     = LogError ?? DefaultLogError;
            LogException = LogException ?? DefaultLogException;
        }
Example #2
0
        public static bool IsLocalMod()
        {
            IMyModContext modContext = Main.Session.ModContext;

            foreach (MyObjectBuilder_Checkpoint.ModItem mod in MyAPIGateway.Session.Mods)
            {
                if (mod.Name == modContext.ModId)
                {
                    return(mod.PublishedFileId == 0);
                }
            }

            return(false);
        }
 public ModCrashedException(Exception innerException, IMyModContext modContext) : base("Mod crashed!", innerException)
 {
     this.ModContext = modContext;
 }