Example #1
0
    public void die()
    {
        incrementPlayerPref("lossCounter");
        if (score > PlayerPrefs.GetInt("highScore"))
        {
            PlayerPrefs.SetInt("highScore", score);
        }

        if (PlayerPrefs.GetInt("lossCounter") % 5 == 0)
        {
            AdUtils.showSkipableAd();
        }

        Instantiate(deathParticles, clonePaddle.transform.position, Quaternion.identity);
        Destroy(clonePaddle);
        Invoke("SetupPaddle", 1f);
        Time.timeScale = 1f;
        SceneManager.LoadScene(0);
    }
Example #2
0
        public void ExpandTokenGroupsViaCrackNames()
        {
            //point this to a user in the directory
            DirectoryEntry user = TestUtils.CreateDirectoryEntry(
                "CN=User1,OU=Users," + TestUtils.Settings.DefaultPartition);

            //you can use another overload to pass credentials
            using (BindingContext ctx = BindingContext.Create())
                using (user)
                {
                    //convert to array of string SIDs
                    int size = user.Properties["tokenGroups"].Count;
                    PropertyValueCollection pvc = user.Properties["tokenGroups"];

                    string[] sids = new string[size];

                    for (int i = 0; i < size; i++)
                    {
                        sids[i] = AdUtils.ConvertSidToString((byte[])pvc[i]);
                    }

                    //we want to pass in the SID format and retrieve
                    //the NT Format names.  This utility class is
                    //included in our web site library samples
                    //groupNames contains all the converted groups now
                    string[] groupNames = AdUtils.DsCrackNamesWrapper(
                        sids,
                        ctx.Handle,
                        DS_NAME_FORMAT.DS_SID_OR_SID_HISTORY_NAME,
                        DS_NAME_FORMAT.DS_NT4_ACCOUNT_NAME
                        );

                    foreach (string group in groupNames)
                    {
                        Console.WriteLine(group);
                    }
                }
        }