Beispiel #1
0
 protected void Init(AceUserSettings settings)
 {
     Logger = UniLogger.GetLogger("CliDriver");
     fe     = new AceCliFrontend(settings);
     gn     = new AceGameNet();
     appl   = new AceApplication(gn, fe);
     appl.Start(settings.startMode);
 }
Beispiel #2
0
        static void Main(string[] args)
        {
            AceUserSettings settings = GetSettings(args);

            UniLogger.SetupLevels(settings.logLevels);
            CliDriver drv = new CliDriver();

            drv.Run(settings);
        }
Beispiel #3
0
 public void CallInit(AceUserSettings bus)
 {
     base.Init(bus);
 }
Beispiel #4
0
        public static AceUserSettings GetSettings(string[] args)
        {
            AceUserSettings settings = UserSettingsMgr.Load();

            Parser.Default.ParseArguments <CliOptions>(args)
            .WithParsed <CliOptions>(o =>
            {
                if (o.Settings != null)
                {
                    settings = UserSettingsMgr.Load(o.Settings);
                }

                if (o.ForceDefaultSettings)
                {
                    settings = AceUserSettings.CreateDefault();
                }

                if (o.ThrowOnError)
                {
                    UniLogger.DefaultThrowOnError = true;
                }

                if (o.DefLogLvl != null)
                {
                    settings.defaultLogLevel = o.DefLogLvl;
                }

                if (o.NetName != null)
                {
                    settings.apianNetworkName = o.NetName;
                }

                if (o.Validator)
                {
                    settings.tempSettings["validator"] = "true";
                }

                if (o.GameName != null)
                {
                    settings.tempSettings["gameName"] = o.GameName;
                }

                if (o.GroupType != null)
                {
                    settings.tempSettings["groupType"] = o.GroupType;
                }

                if (o.StartMode != -1)
                {
                    settings.startMode = o.StartMode;
                }
            }).WithNotParsed(o =>
            {
                // --help, --version, or any error results in this getting called
                settings = null;
            });

            if (settings != null)
            {
                UserSettingsMgr.Save(settings);
            }
            return(settings);
        }
Beispiel #5
0
 public void Run(AceUserSettings settings)
 {
     Init(settings);
     LoopUntilDone();
 }
Beispiel #6
0
 // Start is called before the first frame update
 public AceCliFrontend(AceUserSettings startupSettings)
 {
     userSettings = startupSettings;
     logger       = UniLogger.GetLogger("Frontend");
 }