Example #1
0
    // Start is called before the first frame update
    void Start()
    {
        userSettings = UserSettingsMgr.Load(kSettingsFileBaseName);
        //userSettings = BeamUserSettings.CreateDefault();
        userSettings.localPlayerCtrlType = BikeFactory.LocalPlayerCtrl; // Kinda hackly

        mainObj       = BeamMain.GetInstance();
        _feModeHelper = new BeamFeModeHelper(mainObj);
        feBikes       = new Dictionary <string, GameObject>();
        logger        = UniLogger.GetLogger("Frontend");
    }
Example #2
0
        protected static BeamUserSettings GetSettings(string[] args)
        {
            BeamUserSettings settings = UserSettingsMgr.Load();

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

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

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

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

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

                if (o.StartMode != -1)
                {
                    settings.startMode = o.StartMode;
                }

                // TODO: would rather have the frontend implmentation determine this somehow
                if (o.BikeCtrl != null)
                {
                    settings.localPlayerCtrlType = o.BikeCtrl;
                }
            });

            UserSettingsMgr.Save(settings);
            return(settings);
        }
Example #3
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);
        }
Example #4
0
        protected static BeamUserSettings GetSettings(string[] args)
        {
            BeamUserSettings settings = UserSettingsMgr.Load();

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

                if (o.ForceDefaultSettings)
                {
                    settings = BeamUserSettings.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.GameName != null)
                {
                    settings.tempSettings["gameName"] = o.GameName;
                }

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

                if (o.StartMode != -1)
                {
                    settings.startMode = o.StartMode;
                }

                // TODO: would rather have the frontend implmentation determine this somehow
                if (o.BikeCtrl != null)
                {
                    settings.localPlayerCtrlType = o.BikeCtrl;
                }
            }).WithNotParsed(o =>
            {
                // --help, --version, or any error results in this getting called
                settings = null;
            });

            if (settings != null)
            {
                UserSettingsMgr.Save(settings);
            }
            return(settings);
        }