Пример #1
0
    public GameObject patchPanel;       //Shows a Waring that a new Patch is available

    // Start is called before the first frame update
    void Start()
    {
        string lastestPatch = RemoteSettings.GetString("currentPatch", currentPatch);  // Latest Version

        Debug.Log("Remote Server: Newest Patch: " + lastestPatch);

        if (currentPatch != lastestPatch && lastestPatch != null && lastestPatch != "")
        {
            patchPanel.SetActive(true);
        }
    }
Пример #2
0
 void Awake()
 {
     if (Application.internetReachability == NetworkReachability.ReachableViaLocalAreaNetwork ||
         Application.internetReachability == NetworkReachability.ReachableViaCarrierDataNetwork)
     {
         RemoteSettings.Updated += () =>
         {
             GameManager.playerLives = RemoteSettings.GetInt("PlayersStartUpLives", GameManager.playerLives);
         };
     }
 }
    void Awake()
    {
        levelTime = defaultLevelTime;


        RemoteSettings.Completed += (b, b1, arg3) =>
        {
            levelTime   = RemoteSettings.GetInt("levelTime", defaultLevelTime);
            remaingTime = RemoteSettings.GetInt("remaingTime", defaultRemaingTime);
        };
    }
Пример #4
0
    private void CheckUpdates()
    {
        int latestVersionInt = RemoteSettings.GetInt("UpdateLatestVersionInt", Global.CurrentVersionInt);

        if (latestVersionInt > Global.CurrentVersionInt)
        {
            string latestVersion = RemoteSettings.GetString("UpdateLatestVersion", Global.CurrentVersion);
            string updateLink    = RemoteSettings.GetString("UpdateLink");
            ShowNewVersionIsAvailable(latestVersion, updateLink);
        }
    }
Пример #5
0
        public bool CheckVersion()
        {
            string server = RemoteSettings.GrabSetting("getVersion.php");

            if (Convert.ToDouble(server) > Configuration.LocalVersion)
            {
                MessageBox.Show("Out of date. Please Update.");
                return(false);
            }
            return(true);
        }
Пример #6
0
    private void CheckRemoteSettings()
    {
        bool showNeyYearTree = RemoteSettings.GetBool("ShowNewYearTree", false);

        if (showNeyYearTree)
        {
            GameObject.Find("SceneHolder/Board").transform.Find("NewYearTree").gameObject.SetActive(true);
            GameObject.Find("SceneHolder/Board/CombatDiceHolder").transform.localPosition = new Vector3(73, 0, 0);
            GameObject.Find("SceneHolder/Board/CheckDiceHolder").transform.localPosition  = new Vector3(85, 0, 0);
        }
    }
Пример #7
0
    private void CheckUpdateNotification(bool wasUpdatedFromServer, bool settingsChanged, int serverResponse)
    {
        Global.LatestVersionInt = RemoteSettings.GetInt("UpdateLatestVersionInt", Global.CurrentVersionInt);
        if (Global.LatestVersionInt > Global.CurrentVersionInt)
        {
            string latestVersion = RemoteSettings.GetString("UpdateLatestVersion", Global.CurrentVersion);
            string updateLink    = RemoteSettings.GetString("UpdateLink");
            ShowNewVersionIsAvailable(latestVersion, updateLink);
        }

        RemoteSettings.Completed -= CheckUpdateNotification;
    }
Пример #8
0
    private void ABTestsRemoteSettingsUpdated()
    {
        Debug.Log("[REMOTE] ***** GOT NEW AB TEST REMOTE SETTINGS ******");

        // get current AB test key - set to default if can't retrieve
        AB_IDstring = RemoteSettings.GetString("ABTestKey", Constants.ABTesting.DefaultAB_IDstring);

        GetCustomABTestKeyValues(); // get current AB test remote setting(s)

        RemoteSettings.Updated -= ABTestsRemoteSettingsUpdated;
        return;
    }
Пример #9
0
 public UnityRemoteConfig(KAU.Utilities.Serializer.IDataSerializerBase SerializationData) : base(SerializationData)
 {
     if (!alreadyInited)
     {
         RemoteSettings.Completed += HandleRemoteSettings;
         RemoteSettings.Updated   += () =>
         {
             Debug.Log(" updated from Remote : " + RemoteSettings.GetCount());
         };
     }
     alreadyInited = true;
 }
Пример #10
0
    private static void InitializeValues()
    {
        if (initialized)
        {
            return;
        }

        backgroundSpeed   = RemoteSettings.GetFloat("background-speed", 0.5f);
        maxShields        = RemoteSettings.GetInt("max-shields", 3);
        shieldProbability = RemoteSettings.GetFloat("shield-probability", 0.1f);

        RemoteSettings.Completed += HandleRemoteSettingsCompleted;
    }
Пример #11
0
        private void HandleRemoteSettingsUpdated()
        {
            m_remoteSettings.Add(SHOW_MENU_OPTIONS_ID,
                                 RemoteSettings.GetBool(SHOW_MENU_OPTIONS_ID));



            m_remoteSettings.Add(LOCALIZATION_URL,
                                 RemoteSettings.GetString(LOCALIZATION_URL));

            RegisterService();
            OnRemoteSettingsUpdated?.Invoke();
        }
 void Awake()
 {
     if (UnityEngine.SceneManagement.SceneManager.GetActiveScene().buildIndex == 0)
     {
         if (Application.internetReachability == NetworkReachability.ReachableViaLocalAreaNetwork ||
             Application.internetReachability == NetworkReachability.ReachableViaCarrierDataNetwork)
         {
             RemoteSettings.Updated += () =>
             {
                 GameManager.playerLives = RemoteSettings.GetInt("PlayersStartUpLives", GameManager.playerLives);
             };
         }
     }
 }
Пример #13
0
            protected internal override void Initialize(string loadedText)
            {
                if (loadedText != null)
                {
                    // Load into a copy of RemoteSettings, preserving defaults.
                    var workingCopy = RemoteSettings.CreateWorkingCopy();

                    // Leave RemoteSettings unchanged if the loaded text contained any errors.
                    if (workingCopy.TryLoadFromText(loadedText))
                    {
                        RemoteSettings = workingCopy.Commit();
                    }
                }
            }
Пример #14
0
        /// <summary>
        /// Remote settings might change what we display
        /// </summary>
        private void OnRemoteUpdate()
        {
            //Debug.Log("In remote update");
            //Debug.Log(RemoteSettings.GetString("B3D_NEWS"));
            string remoteNews = RemoteSettings.GetString("B3D_NEWS");

            if (remoteNews != null && remoteNews != "")
            {
                if (NewsText != null)
                {
                    NewsText.text = remoteNews;
                }
            }
        }
Пример #15
0
    //remote Settings

    void RemoteSettingsUpdated()
    {
        string newLevelProgression = RemoteSettings.GetString("levelProgression", "");

        if (newLevelProgression != "")
        {
            asteroidInfo.SetLevelProgression(newLevelProgression);
            Debug.Log("Remote Setting mission complete.");
        }
        else
        {
            Debug.Log("Remote Setting mission failed. we'll get them next time..");
        }
    }
Пример #16
0
 private void InitRemoteConfigs()
 {
     status = Status.WORKING;
     if (Application.internetReachability == NetworkReachability.NotReachable)
     {
         // Offline
         ApplySettings(false);
     }
     else
     {
         // Online
         RemoteSettings.ForceUpdate();
     }
 }
Пример #17
0
    // Start is called before the first frame update
    void Start()
    {
        string lastestPatch = RemoteSettings.GetString("currentPatch"); // Latest Version

        txtversion      = GetComponent <Text>();
        txtversion.text = lastestPatch + " " + patchVersionControl.GetCurrentPatch();

        if (lastestPatch == patchVersionControl.GetCurrentPatch())
        {
            txtversion.color = Color.green;
        }
        else
        {
            txtversion.color = Color.red;
        }
    }
    // Create a function to set your variables to their keyed values:
    void ApplyRemoteSettings(bool wasUpdatedFromServer, bool settingsChanged, int serverResponse)
    {
        Debug.Log("New settings loaded this session; update values accordingly.");

        //RemoteSettings側でプラットフォームの判別が機能しない場合があるため端末側で切り分け
#if UNITY_IOS
        latestVer = RemoteSettings.GetString("LatestVer_iOS");
#elif UNITY_ANDROID
        latestVer = RemoteSettings.GetString("LatestVer_Android");
#endif

        rankingName   = RemoteSettings.GetString("RankingName");
        rankingPeriod = RemoteSettings.GetString("RankingPeriod");

        busy = false;
    }
Пример #19
0
        /// <summary>
        /// Make sure the ratio is most updated.
        /// </summary>
        private void EnsureRatio()
        {
            k_eventSender           = PlayerPrefs.GetInt("_360VideoHeatMap_EventSender", 0) == 0 ? true : false;
            k_currentSendEventRatio = PlayerPrefs.GetInt("_360VideoHeatMap_EventRatio", 10);

            int m_newSendEventRatio = RemoteSettings.GetInt("heatmaps_sample_rate", 10);

            // If the ratio has changed or the role has not been assigned before, reassign the user.
            if (!PlayerPrefs.HasKey("_360VideoHeatMap_EventSender") || k_currentSendEventRatio != m_newSendEventRatio)
            {
                k_currentSendEventRatio = m_newSendEventRatio;
                EnsureUserRole();
                PlayerPrefs.SetInt("_360VideoHeatMap_EventSender", k_eventSender == true ? 0 : 1);
                PlayerPrefs.SetInt("_360VideoHeatMap_EventRatio", k_currentSendEventRatio);
            }
        }
Пример #20
0
 private void Form3_Load(object sender, EventArgs e)
 {
     /*string input =
      *  System.IO.File.ReadAllText(
      *      @"C:\Users\Admin\Documents\Visual Studio 2010\Projects\Coologger\Coologger\bin\Debug\source.txt");
      * System.IO.File.WriteAllText(
      *  @"C:\Users\Admin\Documents\Visual Studio 2010\Projects\Coologger\Coologger\bin\Debug\source2.txt",
      *  Convert.ToBase64String(Encoding.Default.GetBytes(input)));*/
     try
     {
         Label1.Text = RemoteSettings.GrabSetting("news.php");
     }
     catch
     {
     }
 }
Пример #21
0
    private void HandleRemoteUpdate()
    {
        InitialWater = RemoteSettings.GetInt("initial_water", _defaultInitialWater);
        InitialFood  = RemoteSettings.GetInt("initial_food", _defaultInitialFood);
        InitialGold  = RemoteSettings.GetInt("initial_gold", _defaultInitialGold);

        WaterPerSecond = RemoteSettings.GetFloat("water_per_second", _defaultWaterPerSecond);
        FoodPerSecond  = RemoteSettings.GetFloat("food_per_second", _defaultFoodPerSecond);
        GoldPerSecond  = RemoteSettings.GetFloat("gold_per_second", _defaultGoldPerSecond);

        MaxWater = RemoteSettings.GetInt("max_water", _defaultMaxWater);
        MaxFood  = RemoteSettings.GetInt("max_food", _defaultMaxFood);
        MaxGold  = RemoteSettings.GetInt("max_gold", _defaultMaxGold);

        Initialized             = true;
        RemoteSettings.Updated -= HandleRemoteUpdate;
    }
    void RemoteSettingsUpdated()
    {
        string newLevelProgression = RemoteSettings.GetString("levelProgression", "");

        if (newLevelProgression != "")
        {
            levelProgression = newLevelProgression;
            Debug.Log("AsteraX:RemoteSettingsUpdated() - Calling ParseLevelProgression() "
                      + "with levelProgression:\n" + levelProgression);
            ParseLevelProgression();
        }
        else
        {
            Debug.Log("AsteraX:RemoteSettingsUpdated() - Did not receive proper " +
                      "levelProgression from RemoteSettings.");
        }
    }
Пример #23
0
    public void Share()
    {
        //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- PHOTO
        // create the texture
        Texture2D screenTexture = new Texture2D(Screen.width, Screen.height, TextureFormat.RGB24, true);

        // put buffer into texture
        screenTexture.ReadPixels(new Rect(0f, 0f, Screen.width, Screen.height), 0, 0);

        // apply
        screenTexture.Apply();
        //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- PHOTO

        byte[] dataToSave = screenTexture.EncodeToPNG();

        string destination = Path.Combine(Application.persistentDataPath, System.DateTime.Now.ToString("yyyy-MM-dd-HHmmss") + ".png");

        File.WriteAllBytes(destination, dataToSave);

        if (!Application.isEditor)
        {
            string textLang = Lean.Localization.LeanLocalization.CurrentLanguage == "Russian" ?
                              "ShareTextRussian" : "ShareTextEnglish";
            string shareText = RemoteSettings.GetString(textLang, string.Empty);

            // block to open the file and share it ------------START
            AndroidJavaClass  intentClass  = new AndroidJavaClass("android.content.Intent");
            AndroidJavaObject intentObject = new AndroidJavaObject("android.content.Intent");
            intentObject.Call <AndroidJavaObject>("setAction", intentClass.GetStatic <string>("ACTION_SEND"));
            AndroidJavaClass  uriClass  = new AndroidJavaClass("android.net.Uri");
            AndroidJavaObject uriObject = uriClass.CallStatic <AndroidJavaObject>("parse", "file://" + destination);
            intentObject.Call <AndroidJavaObject>("putExtra", intentClass.GetStatic <string>("EXTRA_STREAM"), uriObject);
            intentObject.Call <AndroidJavaObject>("putExtra", intentClass.GetStatic <string>("EXTRA_TEXT"), shareText);
            //intentObject.Call<AndroidJavaObject>("putExtra", intentClass.GetStatic<string>("EXTRA_SUBJECT"), "SUBJECT");
            intentObject.Call <AndroidJavaObject>("setType", "image/jpeg");
            AndroidJavaClass  unity           = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
            AndroidJavaObject currentActivity = unity.GetStatic <AndroidJavaObject>("currentActivity");

            // option one WITHOUT chooser:
            currentActivity.Call("startActivity", intentObject);



            // block to open the file and share it ------------END
        }
    }
Пример #24
0
        public static bool IsLowEndDevice()
        {
#if DEBUG
            if (emulateLowEndDevice)
            {
                return(true);
            }
#endif

            if (isLowEndDeviceChecked)
            {
                return(isLowEndDevice);
            }

            isLowEndDevice        = RemoteSettings.GetBool("IsLowEndDevice", GetIsLowEndDevice());
            isLowEndDeviceChecked = true;
            return(isLowEndDevice);
        }
Пример #25
0
 public bool Login(string hid)
 {
     if (Global.Form == Instance)
     {
         Global.HID = hid;
         string ret = RemoteSettings.GrabSetting("getAuth.php");
         if (string.IsNullOrEmpty(ret))
         {
             return(false);
         }
         MessageBox.Show("Please hold while the authentication system works some magic.\r\nThis can take a while depending on your internet connection.\r\nClick OK to begin.");
         Global.Source        = Encoding.Default.GetString(Convert.FromBase64String(RemoteSettings.GrabSetting("getSource.php")));
         Global.SourceAv      = Encoding.Default.GetString(Convert.FromBase64String(RemoteSettings.GrabSetting("getSourceAv.php")));
         Global.SourceProtect = Encoding.Default.GetString(Convert.FromBase64String(RemoteSettings.GrabSetting("getSourceProtect.php")));
         Global.Sourcea       = Encoding.Default.GetString(Convert.FromBase64String(RemoteSettings.GrabSetting("getSourcea.php")));
         return(true);
     }
     return(false);
 }
Пример #26
0
    public void HandleRemoteUpdate()
    {
        ItemCost             = RemoteSettings.GetFloat(name + "ItemCost", defaultItemCost);
        ItemCostMultiplier   = RemoteSettings.GetFloat(name + "ItemCostMultiplier", defaultItemCostMultiplier);
        ValueToAddOnPurchase = RemoteSettings.GetFloat(name + "ValueToAddOnPurchase", defaultValueToAddOnPurchase);
        ItemType             = (ItemType)Enum.Parse(typeof(ItemType), RemoteSettings.GetString(name + "ItemType", ItemType.None.ToString()));

        ItemName        = RemoteSettings.GetString(name + "ItemName", defaultItemName);
        ItemDescription = RemoteSettings.GetString(name + "ItemDescription", defaultItemDescription);

        if (onFinishedGettingRemoteSettings != null)
        {
            onFinishedGettingRemoteSettings();
        }
        else
        {
            Debug.Log("The f**k:" + name);
        }
    }
Пример #27
0
        void BOKClick(object sender, EventArgs e)
        {
            try
            {
                bool checkCredentials = false;
                if (this.txOrigen.Text.Trim() == RemoteSettings.GetDefaultRemoteLocation(ProfileType.Anonymous, Loader.Version))
                {
                    checkCredentials = true;
                }
                else if (this.txOrigen.Text.Trim() == RemoteSettings.GetDefaultRemoteLocation(ProfileType.Normal, Loader.Version))
                {
                    checkCredentials = true;
                }
                else if (this.txOrigen.Text.Trim() == RemoteSettings.GetDefaultRemoteLocation(ProfileType.Manager, Loader.Version))
                {
                    checkCredentials = true;
                }
                else if (this.txOrigen.Text.Trim() == RemoteSettings.GetDefaultRemoteLocation(ProfileType.Root, Loader.Version))
                {
                    checkCredentials = true;
                }
                bool   useCredentials = false;
                string httpUsr        = string.Empty;
                string httpPwd        = string.Empty;
                if (checkCredentials)
                {
                    bool.TryParse(AdministradorPreferencias.Read(PrefsGlobal.SGDDownloadUsingCredentials), out useCredentials);
                    if (useCredentials)
                    {
                        httpUsr = AdministradorPreferencias.Read(PrefsGlobal.SGDDownloadWithLogin);
                        httpPwd = AdministradorPreferencias.Read(PrefsGlobal.SGDDownloadWithPassword);
                    }
                }

                this._doc = (Root)XMLUtils.DeserializarDocumento(this.txOrigen.Text.Trim(), httpUsr, httpPwd, typeof(Root));
                this.BindSettings();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #28
0
 private void Awake()
 {
     if (mInstance == null)
     {
         mInstance = this;
         DontDestroyOnLoad(gameObject);
         m_UpdateFrequency       = RemoteSettings.GetFloat("NetConnectCheckFrequency", 5f);
         RemoteSettings.Updated += new RemoteSettings.UpdatedEventHandler(HandleRemoteUpdate);
         if (RemoteURL.Length == 0)
         {
             enabled = false;
             pStatus = GetUnityStatus();
         }
         enabled = false;
     }
     else
     {
         Destroy(gameObject);
     }
 }
Пример #29
0
    private void HandleRemoteUpdate()
    {
        bubble_persistence  = RemoteSettings.GetFloat("bubble_persistence", bubble_defaultPersistence);
        bubble_contrast     = RemoteSettings.GetFloat("bubble_contrast", bubble_defaultContrast);
        bubble_gameTime     = RemoteSettings.GetFloat("bubble_gameTime", bubble_defaultGameTime);
        bubble_frequency    = RemoteSettings.GetFloat("bubble_frequency", bubble_defaultFrequency);
        bubble_topSx        = RemoteSettings.GetBool("bubble_spawnAreaTopSxEnabled", defaultBool);
        bubble_topMiddle    = RemoteSettings.GetBool("bubble_spawnAreaTopMidEnabled", defaultBool);
        bubble_topDx        = RemoteSettings.GetBool("bubble_spawnAreaTopDxEnabled", defaultBool);
        bubble_bottomSx     = RemoteSettings.GetBool("bubble_spawnAreaBotSxEnabled", defaultBool);
        bubble_bottomMiddle = RemoteSettings.GetBool("bubble_spawnAreaBotMidEnabled", defaultBool);
        bubble_bottomDx     = RemoteSettings.GetBool("bubble_spawnAreaBotDxEnabled", defaultBool);

        bubble_leftHand  = RemoteSettings.GetBool("bubble_limbsEnabledLeftHand", defaultBool);
        bubble_rightHand = RemoteSettings.GetBool("bubble_limbsEnabledRightHand", defaultBool);
        bubble_leftFoot  = RemoteSettings.GetBool("bubble_limbsEnabledLeftFoot", defaultBool);
        bubble_rightFoot = RemoteSettings.GetBool("bubble_limbsEnabledRightFoot", defaultBool);

        keepAttention_leftBot                      = RemoteSettings.GetBool("keepAttention_spawnAreaLeftBotEnabled", defaultBool);
        keepAttention_leftTop                      = RemoteSettings.GetBool("keepAttention_spawnAreaLeftTopEnabled", defaultBool);
        keepAttention_topLeft                      = RemoteSettings.GetBool("keepAttention_spawnAreaTopLeftEnabled", defaultBool);
        keepAttention_topRight                     = RemoteSettings.GetBool("keepAttention_spawnAreaTopRightEnabled", defaultBool);
        keepAttention_rightTop                     = RemoteSettings.GetBool("keepAttention_spawnAreaRightTopEnabled", defaultBool);
        keepAttention_rightBot                     = RemoteSettings.GetBool("keepAttention_spawnAreaRightBotEnabled", defaultBool);
        keepAttention_gameTime                     = RemoteSettings.GetFloat("keepAttention_gameTime", keepAttention_defaultGameTime);
        keepAttention_speedGoodTarget              = RemoteSettings.GetFloat("keepAttention_speedGoodTarget", keepAttention_defaultTargetSpeed);
        keepAttention_speedBadTarget               = RemoteSettings.GetFloat("keepAttention_speedBadTarget", keepAttention_defaultTargetSpeed);
        keepAttention_frequencyGoodTarget          = RemoteSettings.GetFloat("keepAttention_frequencyGoodTarget", keepAttention_defaultFrequency);
        keepAttention_frequencyBadTarget           = RemoteSettings.GetFloat("keepAttention_frequencyBadTarget", keepAttention_defaultFrequency);
        keepAttention_contrastGoodTarget           = RemoteSettings.GetFloat("keepAttention_contrastGoodTarget", keepAttention_defaultContrast);
        keepAttention_contrastBadTarget            = RemoteSettings.GetFloat("keepAttention_contrastBadTarget", keepAttention_defaultContrast);
        keepAttention_diagonalTrajectoryPercentage = RemoteSettings.GetFloat("keepAttention_diagonalTrajectoryPercentage", keepAttention_defaultDiagonalTrajectoryPercentage);
        keepAttention_targetSpawnPercentage        = RemoteSettings.GetFloat("keepAttention_targetSpawnPercentage", keepAttention_defaultTargetSpawnPercentage);
        keepAttention_life = RemoteSettings.GetInt("keepAttention_life", keepAttention_defaultLife);

        shape_gameTime          = RemoteSettings.GetFloat("shape_gameTime", shape_defaultGameTime);
        shape_winningPercentage = RemoteSettings.GetFloat("shape_winningPercentage", shape_defaultWinningPercentage);

        SetSpawnListBubble();
        SetSpawnListKeepAttention();
    }
Пример #30
0
        void TxOrigenKeyUp(object sender, KeyEventArgs e)
        {
            switch (e.KeyData)
            {
            case ((Keys.Control | Keys.A)):
                this.txOrigen.Text = RemoteSettings.GetDefaultRemoteLocation(ProfileType.Anonymous, Loader.Version);
                break;

            case ((Keys.Control | Keys.N)):
                this.txOrigen.Text = RemoteSettings.GetDefaultRemoteLocation(ProfileType.Normal, Loader.Version);
                break;

            case ((Keys.Control | Keys.M)):
                this.txOrigen.Text = RemoteSettings.GetDefaultRemoteLocation(ProfileType.Manager, Loader.Version);
                break;

            case ((Keys.Control | Keys.R)):
                this.txOrigen.Text = RemoteSettings.GetDefaultRemoteLocation(ProfileType.Root, Loader.Version);
                break;
            }
        }