static void Main(string[] args)
        {
            // Temp logger for startup errors
            Context.Log = new ConsoleLogger
            {
                LogLevel = Logger.LogLevels.Info
            };

            // Setup global Context
            Context.Params = new AppParams(args);
            Context.Log    = new LogFileLogger(Context.Params.P <string>("Logger.LogDirectory"),
                                               Context.Params.P <bool>("ConsoleLog"));
            Context.Log.SetLogLevel(Context.Params.P <string>("LogLevel"));

            if (Context.Params.P <bool>("Verbose") || !Context.Params.P <bool>("Quiet"))
            {
                Console.WriteLine("WELCOME TO PROJECT APOLLO METAVERSE API SERVER");
            }
            // This log message has a UTC time header and a local time message
            Context.Log.Info("{0} Started at {1}", _logHeader, DateTime.Now.ToString());

            // Everything will keep running until this TokenSource is cancelled
            Context.KeepRunning = new CancellationTokenSource();

            MetaverseServer server = new MetaverseServer();

            server.Start();

            return;
        }
Exemple #2
0
        static void Main(string[] args)
        {
            // Temp logger for startup errors
            Context.Log = new ConsoleLogger
            {
                LogLevel = Logger.LogLevels.Info
            };

            // Setup global Context
            Context.Params = new AppParams(args);
            Context.Params.LoadSiteParameters();
            Context.Log = new LogFileLogger(Context.Params.P <string>(AppParams.P_LOGGER_LOG_DIR),
                                            Context.Params.P <bool>(AppParams.P_CONSOLELOG));
            Context.Log.SetLogLevel(Context.Params.P <string>(AppParams.P_LOGLEVEL));

            // If asked for the version, just print that out and exit
            if (Context.Params.P <bool>(AppParams.P_VERSION))
            {
                Console.WriteLine("Version=" + ThisAssembly.AssemblyVersion);
                Console.WriteLine("InformationalVersion=" + ThisAssembly.AssemblyInformationalVersion);
                return;
            }

            if (Context.Params.P <bool>(AppParams.P_VERBOSE) || !Context.Params.P <bool>(AppParams.P_QUIET))
            {
                Console.WriteLine("WELCOME TO PROJECT APOLLO METAVERSE API SERVER VERSION "
                                  + ThisAssembly.AssemblyInformationalVersion);
            }

            // This log message has a UTC time header and a local time message
            Context.Log.Info("{0} Started at {1}", _logHeader, DateTime.Now.ToString());
            Context.Log.Info("{0}      Version = {1}", _logHeader, ThisAssembly.AssemblyInformationalVersion);

            // Everything will keep running until this TokenSource is cancelled
            Context.KeepRunning = new CancellationTokenSource();

            MetaverseServer server = new MetaverseServer();

            server.Start();

            return;
        }