예제 #1
0
    void SaveScore()
    {
        int    score = int.Parse(scoreText.text);
        string name  = input.text;

        Leaderboard.AddScore(name, score);
    }
예제 #2
0
        // Token: 0x06001786 RID: 6022 RVA: 0x0006F750 File Offset: 0x0006D950
        protected void ClientSubmitLeaderboardScore(RunReport runReport)
        {
            if (runReport.gameResultType != GameResultType.Won)
            {
                return;
            }
            bool flag = false;

            using (IEnumerator <NetworkUser> enumerator = NetworkUser.readOnlyLocalPlayersList.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    if (enumerator.Current.isParticipating)
                    {
                        flag = true;
                        break;
                    }
                }
            }
            if (!flag)
            {
                return;
            }
            int num = PlayerCharacterMasterController.instances.Count;

            if (num <= 0)
            {
                return;
            }
            if (num >= 3)
            {
                if (num > 4)
                {
                    return;
                }
                num = 4;
            }
            string name = WeeklyRun.GetLeaderboardName(num, this.serverSeedCycle);

            int[]      subScores  = new int[64];
            GameObject bodyPrefab = BodyCatalog.GetBodyPrefab(NetworkUser.readOnlyLocalPlayersList[0].bodyIndexPreference);

            if (!bodyPrefab)
            {
                return;
            }
            SurvivorDef survivorDef = SurvivorCatalog.FindSurvivorDefFromBody(bodyPrefab);

            if (survivorDef == null)
            {
                return;
            }
            subScores[1] = (int)survivorDef.survivorIndex;
            Leaderboard leaderboard = Client.Instance.GetLeaderboard(name, Client.LeaderboardSortMethod.Ascending, Client.LeaderboardDisplayType.TimeMilliSeconds);

            leaderboard.OnBoardInformation = delegate()
            {
                leaderboard.AddScore(true, (int)Math.Ceiling((double)runReport.snapshotTime.t * 1000.0), subScores);
            };
        }
예제 #3
0
        //private void SetPlayerRigidBody()
        //{
        //    Rigidbody rid = player.GetComponent<Rigidbody>();
        //    rid.useGravity = true;
        //    rid.constraints = RigidbodyConstraints.FreezePositionX | RigidbodyConstraints.FreezePositionZ |
        //        RigidbodyConstraints.FreezeRotation;
        //}

        public void GameOver()
        {
            PlayerPrefs.SetInt("JUMPROPEBESTSCORE", int.Parse(combo.bestScore));

            PlayerPrefs.Save();

            Leaderboard.stageNum = 6;
            Leaderboard.AddScore(PlayerPrefs.GetInt("JUMPROPEBESTSCORE"), 6);
        }
        public void GameOver()
        {
            PlayerPrefs.SetInt("COLORGAMEBESTSCORE", int.Parse(csm.combo.bestScore));

            PlayerPrefs.Save();

            MainUIManager.GetInstance().ShowRestartPanel();
            Leaderboard.stageNum = 8;
            Leaderboard.AddScore(PlayerPrefs.GetInt("COLORGAMEBESTSCORE"), 8);
        }
예제 #5
0
        public override void SetScore(string leaderBoardId, int step = 1)
        {
            Leaderboard temp = GetLeaderboard(leaderBoardId);

            if (temp == null)
            {
                return;
            }
            temp.AddScore(true, step, null, OnAddScoreSuccess, OnAddScoreFail);
        }
    public void ProcessResponse(CommandResponse response, int value)
    {
        switch (response)
        {
        case CommandResponse.Start:
            StopAllCoroutines();
            StartCoroutine(DoBackgroundColorChange(highlightColor));
            break;

        case CommandResponse.EndNotComplete:
            StopAllCoroutines();
            StartCoroutine(DoBackgroundColorChange(normalColor));
            break;

        case CommandResponse.EndComplete:
            StopAllCoroutines();
            StartCoroutine(DoBackgroundColorChange(completeColor));
            if (leaderboard != null)
            {
                leaderboard.AddSolve(userName, userColor);
                if (!UserAccess.HasAccess(userName, AccessLevel.NoPoints))
                {
                    leaderboard.AddScore(userName, userColor, value);
                }
                else
                {
                    TwitchPlaySettings.AddRewardBonus(value);
                }
            }
            break;

        case CommandResponse.EndError:
            StopAllCoroutines();
            StartCoroutine(DoBackgroundColorChange(errorColor));
            leaderboard?.AddStrike(userName, userColor, TwitchPlaySettings.data.EnableRewardMultipleStrikes ? value : 1);
            break;

        case CommandResponse.NoResponse:
            StopAllCoroutines();
            StartCoroutine(DoBackgroundColorChange(ignoreColor));
            break;

        case CommandResponse.EndErrorSubtractScore:
            if (!UserAccess.HasAccess(userName, AccessLevel.NoPoints))
            {
                leaderboard?.AddScore(userName, userColor, value);
            }
            break;

        default:
            break;
        }
    }
예제 #7
0
        public static void PlayerDie()
        {
            GameObject other = GameObject.Find("Player");

            PlayerPrefs.SetInt("ROPEGAMESCORE", int.Parse(_gameManger.combo.bestScore));
            PlayerPrefs.Save();
            MainUIManager.GetInstance().ShowRestartPanel();
            Leaderboard.stageNum = 4;
            Leaderboard.AddScore(PlayerPrefs.GetInt("ROPEGAMESCORE"), 4);

            Destroy(other.gameObject);
        }
예제 #8
0
        private void DieCheck()
        {
            if (transform.position.y <= -4f && playerDie == false)
            {
                playerDie = true;
                //gameManager.ResetGame();
                MainUIManager.GetInstance().ShowRestartPanel();
                Leaderboard.stageNum = 5;
                Leaderboard.AddScore(PlayerPrefs.GetInt("JUMPGAMESCORE"), 5);

                playerRigidbody.useGravity = false;
            }
        }
예제 #9
0
    void Game_Over()
    {
        Debug.Log("GAME OVER");
        isDead = true;
        bool qualify = Leaderboard.DoIQualify((int)bossHP.value);

        if (qualify)
        {
            initials.SetActive(true);
            Leaderboard.AddScore("ASS", (int)bossHP.value);
        }
        DestroyGameObject();
    }
예제 #10
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.name == "Punche")
     {
         return;
     }
     else if (other.name == "Player")
     {
         Leaderboard.stageNum = 3;
         Leaderboard.AddScore(PlayerPrefs.GetInt("PUNCHGAMESCORE"), 3);
         MainUIManager.GetInstance().ShowRestartPanel();
     }
 }
예제 #11
0
    public void GameOver()
    {
        MainUIManager.GetInstance().ShowRestartPanel();

        //PlayerPrefs.SetString("ARROWSCORE", combo.scoreText.text);
        PlayerPrefs.SetInt("ARROWBESTSCORE", int.Parse(combo.bestScore));
        PlayerPrefs.Save();

        Leaderboard.stageNum = 2;
        Leaderboard.AddScore(PlayerPrefs.GetInt("ARROWBESTSCORE"), 2);

        //SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
    }
    public static string GiveBonusPoints(Leaderboard leaderboard)
    {
        if (ClearReward == 0 || Players.Count == 0)
        {
            return(data.BombDefusedFooter);
        }
        int    ClearReward2 = Mathf.CeilToInt(ClearReward / (float)Players.Count);
        string message      = string.Format(data.BombDefusedBonusMessage, ClearReward2) + data.BombDefusedFooter;

        foreach (string player in Players)
        {
            leaderboard.AddScore(player, ClearReward2);
        }
        ClearPlayerLog();
        return(message);
    }
예제 #13
0
    public void OnTriggerEnter(Collider other)
    {
        if (other.gameObject.tag == "Player")
        {
            RollRaod.n       = 0f;
            Manager.gameOver = true;
            Manager.isCtrl   = true;

            // 추가
            MainUIManager.GetInstance().ShowRestartPanel();
            //Leaderboard.AddScore(ScoreBook.AddScores());

            PlayerPrefs.SetInt("RUNBESTSCORE", int.Parse(combo.bestScore));
            PlayerPrefs.Save();

            Leaderboard.stageNum = 9;
            Leaderboard.AddScore(PlayerPrefs.GetInt("RUNBESTSCORE"), 9);
        }
    }
예제 #14
0
    // Start is called before the first frame update
    void Start()
    {
        Leaderboard l = new Leaderboard();

        l.AddScore(1, 73);
        l.AddScore(2, 56);
        l.AddScore(3, 39);
        l.AddScore(4, 51);
        l.AddScore(5, 4);
        l.Top(1);
        l.Reset(1);
        l.Reset(2);
        l.AddScore(2, 51);
        l.Top(3);
    }
예제 #15
0
 /* Tries to send the user's name and the high score */
 public void PushServer()
 {
     if (score != null)
     {
         int  number;
         bool success = int.TryParse(score.text.ToString(), out number);
         if (success)
         {
             string myString = System.String.Empty;
             if (letters.Length > 0)
             {
                 foreach (GameObject l in letters)
                 {
                     myString += l.GetComponent <HighScoreLetter> ().GetLetter();
                 }
             }
             leaderBoard.AddScore(myString, number);  //change so this pushes to the server and then closes the canvas.
             LoadFactScene();
         }
     }
 }
예제 #16
0
    public void GameOver()
    {
        isGameOver = true;

        isPlayerDead = true;

        isDangerous = false;

        Generator.IsLanded = true;

        player.GetComponent <PlayerAnimation>().PlayerDead();

        PlayerPrefs.SetInt("BOXGAMEBESTSCORE", int.Parse(combo.bestScore));

        PlayerPrefs.Save();

        MainUIManager.GetInstance().ShowRestartPanel();
        Leaderboard.stageNum = 7;
        Leaderboard.AddScore(PlayerPrefs.GetInt("BOXGAMEBESTSCORE"), 7);

        Debug.Log("Game Over");
    }
예제 #17
0
    void Start()
    {
        ReturnToMainMenu.onClick.AddListener(delegate { SceneManager.LoadScene("MainMenu"); });
        TriggerLeaderboard.onClick.AddListener(delegate { displayLeaderboard = true; });

        WaveRecord.text = "Wave Reached: " + PlayerPrefs.GetInt("Highest Wave Reached", 0).ToString();
        GoldRecord.text = "Gold Earned: " + PlayerPrefs.GetInt("Most Gold Earned", 0).ToString();
        KillRecord.text = "Kill Count: " + PlayerPrefs.GetInt("Most Kills", 0).ToString();

        // Call stats and hero records
        Hero1.sprite = GlobalVariable.GetHero(PlayerPrefs.GetInt("Highest Hero_1", 1)).GetComponent <Hero>().GetSprite();
        Hero2.sprite = GlobalVariable.GetHero(PlayerPrefs.GetInt("Highest Hero_2", 2)).GetComponent <Hero>().GetSprite();
        Hero3.sprite = GlobalVariable.GetHero(PlayerPrefs.GetInt("Highest Hero_3", 3)).GetComponent <Hero>().GetSprite();

        Stats1.text = GlobalVariable.PrintHeroStats(PlayerPrefs.GetInt("Highest Hero_1", 1));
        Stats2.text = GlobalVariable.PrintHeroStats(PlayerPrefs.GetInt("Highest Hero_2", 2));
        Stats3.text = GlobalVariable.PrintHeroStats(PlayerPrefs.GetInt("Highest Hero_3", 3));

        lb.AddScore(PlayerPrefs.GetString("userID"), PlayerPrefs.GetInt("Highest Wave Reached", 0));

        StartCoroutine(RefreshRecords());
    }
    protected override void OnMessageReceived(string userNickName, string userColorCode, string text)
    {
        if (!text.StartsWith("!") || text.Equals("!"))
        {
            return;
        }
        text = text.Substring(1);

        string[] split     = text.ToLowerInvariant().Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
        string   textAfter = split.Skip(1).Join();

        if (text.Equals("cancel", StringComparison.InvariantCultureIgnoreCase))
        {
            if (!IsAuthorizedDefuser(userNickName))
            {
                return;
            }
            _coroutineCanceller.SetCancel();
            return;
        }
        else if (text.Equals("stop", StringComparison.InvariantCultureIgnoreCase))
        {
            if (!IsAuthorizedDefuser(userNickName))
            {
                return;
            }
            _coroutineCanceller.SetCancel();
            _coroutineQueue.CancelFutureSubcoroutines();
            return;
        }
        else if (text.Equals("manual", StringComparison.InvariantCultureIgnoreCase) ||
                 text.Equals("help", StringComparison.InvariantCultureIgnoreCase))
        {
            _ircConnection.SendMessage("!{0} manual [link to module {0}'s manual] | Go to {1} to get the vanilla manual for KTaNE", UnityEngine.Random.Range(1, 100), TwitchPlaysService.urlHelper.VanillaManual);
            _ircConnection.SendMessage("!{0} help [commands for module {0}] | Go to {1} to get the command reference for TP:KTaNE (multiple pages, see the menu on the right)", UnityEngine.Random.Range(1, 100), TwitchPlaysService.urlHelper.CommandReference);
            return;
        }
        else if (text.StartsWith("bonusscore", StringComparison.InvariantCultureIgnoreCase))
        {
            if (!IsAuthorizedDefuser(userNickName))
            {
                return;
            }
            if (split.Length < 3)
            {
                return;
            }
            string playerrewarded = split[1];
            if (!int.TryParse(split[2], out int scorerewarded))
            {
                return;
            }
            if (UserAccess.HasAccess(userNickName, AccessLevel.SuperUser, true))
            {
                _ircConnection.SendMessage(TwitchPlaySettings.data.GiveBonusPoints, split[1], split[2], userNickName);
                Color usedColor = new Color(.31f, .31f, .31f);
                leaderboard.AddScore(playerrewarded, usedColor, scorerewarded);
            }
            return;
        }
        else if (text.StartsWith("reward", StringComparison.InvariantCultureIgnoreCase))
        {
            if (!IsAuthorizedDefuser(userNickName))
            {
                return;
            }
            if (UserAccess.HasAccess(userNickName, AccessLevel.SuperUser, true))
            {
                moduleCountBonus = Int32.Parse(split[1]);
                TwitchPlaySettings.SetRewardBonus(moduleCountBonus);
            }
        }
        else if (text.Equals("timemode", StringComparison.InvariantCultureIgnoreCase))
        {
            if (UserAccess.HasAccess(userNickName, AccessLevel.Mod, true))
            {
                OtherModes.toggleTimedMode();
                _ircConnection.SendMessage(OtherModes.timedModeCheck() ? "Time Mode Enabled" : "Time Mode Disabled");
            }
        }
        else if (text.StartsWith("rank", StringComparison.InvariantCultureIgnoreCase))
        {
            Leaderboard.LeaderboardEntry entry = null;
            if (split.Length > 1)
            {
                int desiredRank;
                switch (split.Length)
                {
                case 3 when split[1].Equals("solo", StringComparison.InvariantCultureIgnoreCase) && int.TryParse(split[2], out desiredRank):
예제 #19
0
 // @TODO: Add losing conditions.
 public void GameOver(bool victory)
 {
     Debug.Log("Done.");
     _moleSpawner.StopSpawner();
     _leaderboard.AddScore(0, (int)_scoreTracker.Score);
 }
예제 #20
0
    void OnGUI()
    {
        GUILayout.BeginArea(new Rect(16, 16, Screen.width - 32, Screen.height - 32));

        if (Client.Instance != null)
        {
            GUILayout.Label("SteamId: " + Client.Instance.SteamId);
            GUILayout.Label("Username: "******"Friend Count: " + Client.Instance.Friends.AllFriends.Count());
            GUILayout.Label("Online Friend Count: " + Client.Instance.Friends.AllFriends.Count(x => x.IsOnline));

            if (Client.Instance.Inventory.Definitions != null)
            {
                GUILayout.Label("Item Definitions: " + Client.Instance.Inventory.Definitions.Length);
            }

            if (Client.Instance.Inventory.Items != null)
            {
                GUILayout.Label("Item Count: " + Client.Instance.Inventory.Items.Length);
            }

            if (serverRequest != null)
            {
                GUILayout.Label("Server List: " + (serverRequest.Finished ? "Finished" : "Querying"));
                GUILayout.Label("Servers Responded: " + serverRequest.Responded.Count);
                GUILayout.Label("Servers Unresponsive: " + serverRequest.Unresponsive.Count);

                if (serverRequest.Responded.Count > 0)
                {
                    GUILayout.Label("Last Server: " + serverRequest.Responded.Last().Name);
                }
            }

            if (leaderBoard != null)
            {
                GUILayout.Label("leaderBoard.IsValid: " + leaderBoard.IsValid);
                GUILayout.Label("leaderBoard.IsError: " + leaderBoard.IsError);

                if (GUILayout.Button("Refresh Leaderboard"))
                {
                    leaderBoard.FetchScores(Leaderboard.RequestType.Global, 0, 100);

                    leaderBoard.AddScore(true, 456, 1, 2, 3, 4, 5, 6);
                }

                if (leaderBoard.IsQuerying)
                {
                    GUILayout.Label("QUERYING..");
                }
                else if (leaderBoard.Results != null)
                {
                    foreach (var result in leaderBoard.Results)
                    {
                        GUILayout.Label(string.Format("{0}. {1} ({2})", result.GlobalRank, result.Name, result.Score));
                    }
                }
                else
                {
                    GUILayout.Label("No Leaderboard results");
                }
            }
        }
        else
        {
            GUILayout.Label("SteamClient Failed. Make sure appropriate files are in root, and steam is running and signed in.");
        }

        GUILayout.EndArea();
    }
예제 #21
0
 public void AddToLeaderboard(int score)
 {
     leaderboard.AddScore(score);
 }