示例#1
0
 public GameServicesSettings()
 {
     // Intialize
     Android = new AndroidSettings();
     AchievementIDCollection = new IDContainer[0];
     LeaderboardIDCollection = new IDContainer[0];
 }
示例#2
0
        public static void BuildProject()
        {
            // Gather values from args
            var options = ArgumentsParser.GetValidatedOptions();

            // Gather values from project
            var scenes = EditorBuildSettings.scenes.Where(scene => scene.enabled).Select(s => s.path).ToArray();

            // Get all buildOptions from options
            BuildOptions buildOptions = BuildOptions.None;

            foreach (string buildOptionString in Enum.GetNames(typeof(BuildOptions)))
            {
                if (options.ContainsKey(buildOptionString))
                {
                    BuildOptions buildOptionEnum = (BuildOptions)Enum.Parse(typeof(BuildOptions), buildOptionString);
                    buildOptions |= buildOptionEnum;
                }
            }

            // Define BuildPlayer Options
            var buildPlayerOptions = new BuildPlayerOptions {
                scenes           = scenes,
                locationPathName = options["customBuildPath"],
                target           = (BuildTarget)Enum.Parse(typeof(BuildTarget), options["buildTarget"]),
                options          = buildOptions
            };

            // Set version for this build
            VersionApplicator.SetVersion(options["buildVersion"]);
            VersionApplicator.SetAndroidVersionCode(options["androidVersionCode"]);

            // Apply Android settings
            if (buildPlayerOptions.target == BuildTarget.Android)
            {
                AndroidSettings.Apply(options);
            }

            // Execute default AddressableAsset content build, if the package is installed
#if USE_ADDRESSABLES
            AddressableAssetSettings.CleanPlayerContent();
            AddressableAssetSettings.BuildPlayerContent();
#endif

            // Perform build
            BuildReport buildReport = BuildPipeline.BuildPlayer(buildPlayerOptions);

            // Summary
            BuildSummary summary = buildReport.summary;
            StdOutReporter.ReportSummary(summary);

            // Result
            BuildResult result = summary.result;
            StdOutReporter.ExitWithResult(result);
        }
示例#3
0
        public async Task SignatureHashSave(string signatureHash)
        {
            AndroidSettings settings = new AndroidSettings()
            {
                SignatureHash = signatureHash
            };
            string key = SecurityAppSettings.ServiceSettings.DocumentTypes.AndroidSettings;
            await DbService.CreateReplaceDocumentAsync(key, settings, key);

            CacheService.AndroidSignatureHash = signatureHash;
        }
示例#4
0
        public static void BuildProject()
        {
            // Gather values from args
            var options = ArgumentsParser.GetValidatedOptions();

            // Gather values from project
            var scenes = EditorBuildSettings.scenes.Where(scene => scene.enabled).Select(s => s.path).ToArray();

            // Define BuildPlayer Options
            var buildOptions = new BuildPlayerOptions {
                scenes           = scenes,
                locationPathName = options["customBuildPath"],
                target           = (BuildTarget)Enum.Parse(typeof(BuildTarget), options["buildTarget"]),
            };

            // Set version for this build
            VersionApplicator.SetVersion(options["version"]);
            VersionApplicator.SetAndroidVersionCode(options["androidVersionCode"]);

            // Apply Android settings
            if (buildOptions.target == BuildTarget.Android)
            {
                AndroidSettings.Apply(options);
            }

            // Perform build
            BuildReport buildReport = BuildPipeline.BuildPlayer(buildOptions);

            // Summary
            BuildSummary summary = buildReport.summary;

            StdOutReporter.ReportSummary(summary);

            // Result
            BuildResult result = summary.result;

            StdOutReporter.ExitWithResult(result);
        }
示例#5
0
        public async Task <IActionResult> UpdateAndroidSettings([FromBody] AndroidSettings settings)
        {
            string accessToken = await HttpContext.GetToken();

            var session = await sessionService.GetSession(accessToken);

            if (session == null)
            {
                return(Unauthorized(new { message = "Session expired. Please login again." }));
            }
            try
            {
                if (settings == null)
                {
                    throw new ArgumentNullException("Settings cannot be null");
                }
                if (settings.UserId != session.UserId)
                {
                    throw new NotSupportedException("You are not allowed to change other user's settings");
                }

                var existing = (await userRepository.GetSettings(session.UserId)).ToDto <UserSettings>();
                existing.AndroidSettings = settings.ToJson();
                var updated = await userRepository.UpdateSettings(existing);

                await log.InfoAsync("User Android Settings updated", context : session.UserId);

                return(Ok(settings));
            }
            catch (Exception ex)
            {
                await log.ErrorAsync("Error in userRepository.GetSettings()", ex);

                return(BadRequest(new { title = ex.GetType().ToString(), details = ex.StackTrace, message = ex.Message }));
            }
        }
		public GameServicesSettings ()
		{
			// Intialize
			Android						= new AndroidSettings();
			AchievementIDCollection		= new IDContainer[0];
			LeaderboardIDCollection		= new IDContainer[0];
		}
		public MediaLibrarySettings ()
		{
			Android		= new AndroidSettings();
		}
示例#8
0
        public async Task <string> SignatureHashGet()
        {
            AndroidSettings settings = await DbService.GetModelByKeyAsyc <AndroidSettings>(SecurityAppSettings.ServiceSettings.DocumentTypes.AndroidSettings);

            return(settings?.SignatureHash);
        }
示例#9
0
        public static void BuildProject()
        {
            // Gather values from args
            var options = ArgumentsParser.GetValidatedOptions();

            // Gather values from project
            var scenes = EditorBuildSettings.scenes.Where(scene => scene.enabled).Select(s => s.path).ToArray();

            // Get all buildOptions from options
            BuildOptions buildOptions = BuildOptions.None;

            foreach (string buildOptionString in Enum.GetNames(typeof(BuildOptions)))
            {
                if (options.ContainsKey(buildOptionString))
                {
                    BuildOptions buildOptionEnum = (BuildOptions)Enum.Parse(typeof(BuildOptions), buildOptionString);
                    buildOptions |= buildOptionEnum;
                }
            }

            // Define BuildPlayer Options
            var buildPlayerOptions = new BuildPlayerOptions {
                scenes           = scenes,
                locationPathName = options["customBuildPath"],
                target           = (BuildTarget)Enum.Parse(typeof(BuildTarget), options["buildTarget"]),
                options          = buildOptions
            };

            // Set version for this build
            VersionApplicator.SetVersion(options["buildVersion"]);
            VersionApplicator.SetAndroidVersionCode(options["androidVersionCode"]);

            // Apply Android settings
            if (buildPlayerOptions.target == BuildTarget.Android)
            {
                AndroidSettings.Apply(options);
            }

            // Execute default AddressableAsset content build, if the package is installed.
            // Version defines would be the best solution here, but Unity 2018 doesn't support that,
            // so we fall back to using reflection instead.
            var addressableAssetSettingsType = Type.GetType(
                "UnityEditor.AddressableAssets.Settings.AddressableAssetSettings,Unity.Addressables.Editor");

            if (addressableAssetSettingsType != null)
            {
                // ReSharper disable once PossibleNullReferenceException, used from try-catch
                void CallAddressablesMethod(string methodName, object[] args) => addressableAssetSettingsType
                .GetMethod(methodName, BindingFlags.Static | BindingFlags.Public)
                .Invoke(null, args);

                try
                {
                    CallAddressablesMethod("CleanPlayerContent", new object[] { null });
                    CallAddressablesMethod("BuildPlayerContent", Array.Empty <object>());
                }
                catch (Exception e)
                {
                    Debug.LogError($"Failed to run default addressables build:\n{e}");
                }
            }

            // Perform build
            BuildReport buildReport = BuildPipeline.BuildPlayer(buildPlayerOptions);

            // Summary
            BuildSummary summary = buildReport.summary;

            StdOutReporter.ReportSummary(summary);

            // Result
            BuildResult result = summary.result;

            StdOutReporter.ExitWithResult(result);
        }
 public MediaLibrarySettings()
 {
     Android = new AndroidSettings();
 }
		public BillingSettings ()
		{
			Products	= new List<BillingProduct>();
			iOS			= new BillingSettings.iOSSettings();
			Android		= new BillingSettings.AndroidSettings();
		}
示例#12
0
 public GameServicesSettings()
 {
     Android = new AndroidSettings();
 }
 public NotificationServiceSettings()
 {
     iOS     = new iOSSettings();
     Android = new AndroidSettings();
 }
示例#14
0
 public BillingSettings()
 {
     Products = new BillingProduct[0];
     iOS      = new BillingSettings.iOSSettings();
     Android  = new BillingSettings.AndroidSettings();
 }
		public NotificationServiceSettings ()
		{
			iOS			= new iOSSettings();
			Android		= new AndroidSettings();
		}
		public BillingSettings ()
		{
			Products	= new BillingProduct[0];
			iOS			= new BillingSettings.iOSSettings();
			Android		= new BillingSettings.AndroidSettings();
		}
示例#17
0
        async protected override void OnCreate(Bundle bundle)
        {
            try
            {
                base.OnCreate(bundle);

                RequestWindowFeature(WindowFeatures.NoTitle);

                // Kontrollera så att användaren har en aktiv internetanslutning
                // CheckConnection();

                Platform.PlatformAndroid.InitAPIs(this);

                AndroidSettings.SetGeneralSetting();

                progress = new ProgressDialog(this);
                progress.Indeterminate = true;
                progress.SetProgressStyle(ProgressDialogStyle.Spinner);
                progress.SetMessage(Lang.LOADING);
                progress.SetCancelable(false);

                //string sUserToken = Helpers.Settings.AccessToken;
                string sUserEmail = Joyces.Helpers.Settings.UserEmail;

                //Skicka användaren vidare till inloggatläge
                if (GeneralSettings.AutoLogin && !string.IsNullOrEmpty(Joyces.Helpers.Settings.AccessToken) && !string.IsNullOrEmpty(sUserEmail))
                {
                    var t = Task.Run(async() => await LoadApp());

                    //Kontrollerar om användaren redan har loggat in en gång
                    //NOTERA! tokens giltigthetstiden kan ha gått ut... ta hand om det på ID-sidan
                    //(förstasidan som syns)

                    //progress.Show();

                    //Joyces.Platform.AppContext.Instance.Platform.CustomerId = sUserEmail;

                    //var getCustomer = await RestAPI.GetCustomer(sUserEmail, Helpers.Settings.AccessToken);

                    //if (getCustomer != null && getCustomer is Customer)
                    //{
                    //    Joyces.Platform.AppContext.Instance.Platform.CustomerList = (Customer)getCustomer;

                    //    var resp = await RestAPI.GetOffer(sUserEmail, Helpers.Settings.AccessToken);

                    //    if (resp != null && resp is List<Offer>)
                    //        Joyces.Platform.AppContext.Instance.Platform.OfferList = (List<Offer>)resp;
                    //    else
                    //        Joyces.Platform.AppContext.Instance.Platform.OfferList = null;

                    //    resp = await RestAPI.GetNews(sUserEmail, Helpers.Settings.AccessToken);

                    //    if (resp != null && resp is List<News>)
                    //        Joyces.Platform.AppContext.Instance.Platform.NewsList = (List<News>)resp;
                    //    else
                    //        Joyces.Platform.AppContext.Instance.Platform.NewsList = null;

                    //    Joyces.Platform.AppContext.Instance.Platform.MoreList = await RestAPI.GetMore(Helpers.Settings.AccessToken);


                    //    var t = Task.Run(async () => await LoadApp());
                    //}
                    //else
                    //{
                    //    Helpers.Settings.AccessToken = string.Empty;
                    //    Helpers.Settings.UserEmail = string.Empty;

                    //    ShowLoginView();
                    //}

                    //progress.Hide();
                }
                else
                {
                    ShowLoginView();
                }
            }
            catch (Exception ex)
            {
                SetContentView(Resource.Layout.Main);
                buttonwMainViewVersion.Text = buttonwMainViewVersion.Text + "_err";

                setCurrentClientTheme();
            }
        }
 public static bool Get(SettingsType settingsType)
 {
     return(AndroidSettings <SettingsType> .GetBool(settingsType));
 }
 public static void Set(SettingsType settingsType, bool value)
 {
     AndroidSettings <SettingsType> .Set(settingsType, value);
 }
示例#20
0
        public override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            this.Activity.ActionBar.SetTitle(Resource.String.settings);

            this.userSettings    = Locator.Current.GetService <UserSettings>();
            this.androidSettings = Locator.Current.GetService <AndroidSettings>();

            this.AddPreferencesFromResource(Resource.Layout.Settings);

            var portPref = (EditTextPreference)this.FindPreference(this.GetString(Resource.String.preference_port));

            portPref.EditText.InputType = InputTypes.ClassNumber;
            portPref.EditText.Events().TextChanged
            .Select(x => Int32.Parse(new string(x.Text.ToArray())))
            .Where(x => !NetworkHelpers.IsPortValid(x))
            .Subscribe(x =>
            {
                portPref.EditText.Error = this.GetString(Resource.String.preference_port_validation_error);
            });
            portPref.BindToSetting(this.userSettings, x => x.Port, x => x.Text, x => int.Parse(x.ToString()), x => x.ToString(), NetworkHelpers.IsPortValid);

            var ipAddressPref = (EditTextPreference)this.FindPreference(this.GetString(Resource.String.preference_ipaddress));

            ipAddressPref.EditText.InputType = InputTypes.ClassPhone;
            ipAddressPref.EditText.Events().TextChanged
            .Select(x => new string(x.Text.ToArray()))
            .Where(x => !IsValidIpAddress(x))
            .Subscribe(x =>
            {
                ipAddressPref.EditText.Error = this.GetString(Resource.String.preference_ipaddress_validation_error);
            });
            ipAddressPref.BindToSetting(this.userSettings, x => x.ServerAddress, x => x.Text, x => (string)x, x => x, IsValidIpAddress);

            var saveEnergyPref = (SwitchPreference)this.FindPreference(this.GetString(Resource.String.preference_save_energy));

            saveEnergyPref.BindToSetting(this.androidSettings, x => x.SaveEnergy, x => x.Checked, x => bool.Parse(x.ToString()));

            var passwordPreference = (EditTextPreference)this.FindPreference(this.GetString(Resource.String.preference_administrator_password));

            passwordPreference.BindToSetting(this.userSettings, x => x.AdministratorPassword, x => x.Text, x => (string)x);
            this.userSettings.WhenAnyValue(x => x.IsPremium, x => x || TrialHelpers.IsInTrialPeriod(AppConstants.TrialTime))
            .BindTo(passwordPreference, x => x.Enabled);

            Preference premiumButton = this.FindPreference(this.GetString(Resource.String.preference_purchase_premium));

            premiumButton.Events().PreferenceClick.Select(_ => this.PurchasePremium().ToObservable()
                                                          .Catch <Unit, Exception>(ex => Observable.Start(() => this.TrackInAppPurchaseException(ex))))
            .Concat()
            .Subscribe();

            Preference restorePremiumButton = this.FindPreference(this.GetString(Resource.String.preference_restore_premium));

            restorePremiumButton.Events().PreferenceClick.Select(_ => this.RestorePremium().ToObservable()
                                                                 .Catch <Unit, Exception>(ex => Observable.Start(() => this.TrackInAppPurchaseException(ex))))
            .Concat()
            .Subscribe();

            Preference versionPreference = this.FindPreference(this.GetString(Resource.String.preference_version));

            versionPreference.Summary = this.Activity.PackageManager.GetPackageInfo(this.Activity.PackageName, 0).VersionName;

            var virtualServerPreference = (SwitchPreference)this.FindPreference(this.GetString(Resource.String.preference_virtual_server));

            virtualServerPreference.Persistent = false;
            virtualServerPreference.Events().PreferenceChange
            .Subscribe(x =>
            {
                if ((bool)x.NewValue)
                {
                    NetworkMessenger.Override(new VirtualNetworkMessenger());
                }

                else
                {
                    NetworkMessenger.ResetOverride();
                }
            });

#if !DEBUG && !DEVELOPMENT
            var developmentCategory = (PreferenceCategory)this.FindPreference(this.GetString(Resource.String.preference_development));

            var screen = (PreferenceScreen)this.FindPreference(this.GetString(Resource.String.preference_main_screen));
            screen.RemovePreference(developmentCategory);
#endif
        }
 public NetworkConnectivitySettings()
 {
     Android		= new AndroidSettings();
     Editor		= new EditorSettings();
 }
 public NetworkConnectivitySettings()
 {
     Android = new AndroidSettings();
     Editor  = new EditorSettings();
 }
示例#23
0
 public BillingSettings()
 {
     Products = new List <BillingProduct>();
     iOS      = new BillingSettings.iOSSettings();
     Android  = new BillingSettings.AndroidSettings();
 }