Ejemplo n.º 1
0
        private void SendScore(PPDGameUtility util, byte[] inputs, bool replaying, string perfectTrialToken)
        {
            if (util.IsRegular && Result != ResultEvaluateType.Mistake && WebManager.Instance.IsLogined && !replaying)
            {
                var hash = util.SongInformation.GetScoreHash(util.Difficulty);
                if (hash != null)
                {
                    ScoreSending?.Invoke();
                    ThreadManager.Instance.GetThread(() =>
                    {
                        var reason = WebManager.Instance.PlayResult(hash, Score, MarkEvals[0], MarkEvals[1], MarkEvals[2], MarkEvals[3], MarkEvals[4], MaxCombo,
                                                                    PPDGameUtility.SongInformation.StartTime, FinishTime, inputs, 3, perfectTrialToken, out Dictionary <string, string> data);

                        if (data.TryGetValue("PerfectTrialResult", out string result))
                        {
                            PerfectTrialSucceess |= result == "1";
                        }
                        ScoreSent?.Invoke(reason, data);
                    }).Start();
                }
            }
        }
Ejemplo n.º 2
0
        public void SendScore(GameMode gameMode, Difficulty difficulty, ScoreboardRequest scoreboard, ScoreSent scoreSent)
        {
            if (gameMode == GameMode.ENDLESS || gameMode == GameMode.FIGHT || gameMode == GameMode.TIMER)
            {
                throw new InvalidParameterException("There is no scoreboard for endless, fight or timer mode");
            }
            string gmStr   = gameMode.ToString().ToLower();
            string diffStr = difficulty.ToString().ToLower();

            SendPutCommand("/register-score/" + gmStr + "/" + diffStr, scoreboard,
                           delegate(String s)
            {
                scoreSent();
            });
        }
Ejemplo n.º 3
0
 protected virtual void OnScoreSent()
 {
     ScoreSent?.Invoke(this, EventArgs.Empty);
 }