/// <summary>
        /// Creates a managed app. StartupArgs are from the args used to start the application. Works with args passed by this bring run by a proccess manager. Connects too
        /// </summary>
        /// <param name="startupArgs"></param>
        /// <param name="system_version_major"></param>
        /// <param name="system_version_minor"></param>
        /// <param name="network"></param>
        /// <returns></returns>
        public static DeltaConnection InitDeltaManagedApp(string[] startupArgs, DeltaCoreNetServerType server_type, byte system_version_major, byte system_version_minor)
        {
            //Validate
            if (startupArgs.Length != 2)
            {
                throw new Exception("The startup args are not valid. This program is supposed to be run from a Delta Process Manager.");
            }

            //Log
            Console.ForegroundColor = ConsoleColor.Cyan;
            Console.WriteLine($"Starting Delta managed app on version {system_version_major}.{system_version_minor} (lib version {LIB_VERSION_MAJOR}.{LIB_VERSION_MINOR})...");
            Console.ForegroundColor = ConsoleColor.White;

            //Create
            var d = new DeltaConnection(int.Parse(startupArgs[0]), long.Parse(startupArgs[1]), system_version_major, system_version_minor, server_type);

            d.serverId = long.Parse(startupArgs[1]);

            //Connect
            d.InitNetworked().GetAwaiter().GetResult();

            return(d);
        }
 public DeltaEventMaster(DeltaConnection conn)
 {
     this.conn = conn;
 }