Пример #1
0
 // Token: 0x0600259B RID: 9627 RVA: 0x000AF76F File Offset: 0x000AD96F
 private void OnServerGameOver(Run run, GameResultType result)
 {
     if (result == GameResultType.Unknown)
     {
         base.Grant();
     }
 }
Пример #2
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,KeyCode,Type")] GameResultType gameResultType)
        {
            if (id != gameResultType.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(gameResultType);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!GameResultTypeExists(gameResultType.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(gameResultType));
        }
			// Token: 0x06002781 RID: 10113 RVA: 0x000AAB98 File Offset: 0x000A8D98
			private void OnServerGameOver(Run run, GameResultType result)
			{
				if (run is WeeklyRun && result == GameResultType.Won)
				{
					base.Grant();
				}
			}
Пример #4
0
        // Token: 0x060021A8 RID: 8616 RVA: 0x0009E640 File Offset: 0x0009C840
        public void SetDisplayData(GameEndReportPanelController.DisplayData newDisplayData)
        {
            if (this.displayData.Equals(newDisplayData))
            {
                return;
            }
            this.displayData = newDisplayData;
            if (this.resultLabel)
            {
                GameResultType gameResultType = GameResultType.Unknown;
                if (this.displayData.runReport != null)
                {
                    gameResultType = this.displayData.runReport.gameResultType;
                }
                string token;
                if (gameResultType != GameResultType.Lost)
                {
                    if (gameResultType != GameResultType.Won)
                    {
                        token = "GAME_RESULT_UNKNOWN";
                    }
                    else
                    {
                        token = "GAME_RESULT_WON";
                    }
                }
                else
                {
                    token = "GAME_RESULT_LOST";
                }
                this.resultLabel.text = Language.GetString(token);
            }
            RunReport runReport = this.displayData.runReport;

            RunReport.PlayerInfo playerInfo = (runReport != null) ? runReport.GetPlayerInfoSafe(this.displayData.playerIndex) : null;
            this.SetPlayerInfo(playerInfo);
            RunReport runReport2 = this.displayData.runReport;
            int       num        = (runReport2 != null) ? runReport2.playerInfoCount : 0;

            this.playerNavigationController.gameObject.SetActive(num > 1);
            this.playerNavigationController.SetDisplayData(new CarouselNavigationController.DisplayData(num, this.displayData.playerIndex));
            ReadOnlyCollection <MPButton> elements = this.playerNavigationController.buttonAllocator.elements;

            for (int i = 0; i < elements.Count; i++)
            {
                MPButton             mpbutton                = elements[i];
                RunReport.PlayerInfo playerInfo2             = this.displayData.runReport.GetPlayerInfo(i);
                CharacterBody        bodyPrefabBodyComponent = BodyCatalog.GetBodyPrefabBodyComponent(playerInfo2.bodyIndex);
                Texture texture = bodyPrefabBodyComponent ? bodyPrefabBodyComponent.portraitIcon : null;
                mpbutton.GetComponentInChildren <RawImage>().texture = texture;
                mpbutton.GetComponent <TooltipProvider>().SetContent(TooltipProvider.GetPlayerNameTooltipContent(playerInfo2.name));
            }
            this.selectedPlayerEffectRoot.transform.SetParent(this.playerNavigationController.buttonAllocator.elements[this.displayData.playerIndex].transform);
            this.selectedPlayerEffectRoot.gameObject.SetActive(false);
            this.selectedPlayerEffectRoot.gameObject.SetActive(true);
            this.selectedPlayerEffectRoot.offsetMin  = Vector2.zero;
            this.selectedPlayerEffectRoot.offsetMax  = Vector2.zero;
            this.selectedPlayerEffectRoot.localScale = Vector3.one;
        }
Пример #5
0
 public void StopGame(GameResultType type)
 {
     if (Game != null)
     {
         dbService.GameEnd(Game, gameResultType: type);
         StopGameInternal();
     }
 }
Пример #6
0
 public void Add(GameResultType result, int x)
 {
     if (results.ContainsKey(result))
     {
         Remove(result);
     }
     results.Add(result, x);
 }
Пример #7
0
 private static void Run_OnServerGameOver(Run obj, GameResultType resultType)
 {
     if (ShowMsg.Value)
     {
         TimeSpan time = TimeSpan.FromSeconds(timeSavedTotal);
         string   hms  = time.ToString(@"h\:mm\:ss");
         SendBroadcast($"Total time saved this run: {hms}");
         timeSavedTotal = 0;
     }
 }
Пример #8
0
 // Token: 0x060028C4 RID: 10436 RVA: 0x000ACF42 File Offset: 0x000AB142
 private void OnServerGameOver(Run run, GameResultType gameResultType)
 {
     if (gameResultType == GameResultType.Won)
     {
         if (this.runOk && !this.failed)
         {
             base.Grant();
         }
         this.runOk = false;
     }
 }
Пример #9
0
        public static string Description(GameResultType gameResultType)
        {
            string result;

            if (_gameresulttypedesc.TryGetValue(gameResultType, out result))
            {
                return(result);
            }

            return(string.Empty);
        }
Пример #10
0
        public void StopGame(GameResultType type)
        {
            if (!IsGameRun)
            {
                return;
            }

            IsGameRun = false;
            scoreBoardService.CloseScoreBoard();
            detectionService.StopDetection();
            drawService.ProjectionClear();
            dbService.GameEnd(Game, gameResultType: type);
        }
        private GameResultType GetGameResultType(GameResultType existsForecast, GameResultType forecast)
        {
            switch (existsForecast)
            {
            case GameResultType.Defeat:
            case GameResultType.RefundOrCancellation:
            case GameResultType.Win:
                return(existsForecast);

            default:
                return(forecast);
            }
        }
Пример #12
0
        public void GameEnd(Game.Game game, GameResultType gameResultType = GameResultType.NotDefined, Player winner = null)
        {
            GameSaveEndTimeStamp(game);

            if (gameResultType == GameResultType.Aborted ||
                gameResultType == GameResultType.Error)
            {
                StatisticUpdateAllPlayersSetGameResultAbortedOrError(game.Id, gameResultType);
            }
            else if (winner != null)
            {
                StatisticUpdateAllPlayersSetGameResultForWinnersAndLosers(game.Id, winner.Id);
            }
        }
 // Token: 0x06001CF3 RID: 7411 RVA: 0x00086C80 File Offset: 0x00084E80
 private static void OnServerGameOver(Run run, GameResultType result)
 {
     if (result != GameResultType.Lost)
     {
         foreach (PlayerStatsComponent playerStatsComponent in PlayerStatsComponent.instancesList)
         {
             if (playerStatsComponent.playerCharacterMasterController.isConnected)
             {
                 StatSheet      currentStats = playerStatsComponent.currentStats;
                 PerBodyStatDef totalWins    = PerBodyStatDef.totalWins;
                 GameObject     bodyPrefab   = playerStatsComponent.characterMaster.bodyPrefab;
                 currentStats.PushStatValue(totalWins.FindStatDef(((bodyPrefab != null) ? bodyPrefab.name : null) ?? ""), 1UL);
             }
         }
     }
 }
Пример #14
0
        public void StopGame(GameResultType type)
        {
            if (Game != null)
            {
                if (type == GameResultType.Aborted &&
                    Game.Points == GamePoints.Free) // todo ugly
                {
                    Game.Result = GameResultType.NotDefined;
                }
                else
                {
                    Game.Result = type;
                }

                StopGameInternal();
            }
        }
Пример #15
0
        // Token: 0x060019BC RID: 6588 RVA: 0x0007ACE4 File Offset: 0x00078EE4
        public static RunReport Generate([NotNull] Run run, GameResultType resultType)
        {
            RunReport runReport = new RunReport();

            runReport.gameModeIndex  = GameModeCatalog.FindGameModeIndex(run.gameObject.name);
            runReport.seed           = run.seed;
            runReport.snapshotTime   = Run.FixedTimeStamp.now;
            runReport.gameResultType = resultType;
            runReport.ruleBook.Copy(run.ruleBook);
            runReport.playerInfos = new RunReport.PlayerInfo[PlayerCharacterMasterController.instances.Count];
            for (int i = 0; i < runReport.playerInfos.Length; i++)
            {
                runReport.playerInfos[i] = RunReport.PlayerInfo.Generate(PlayerCharacterMasterController.instances[i]);
            }
            runReport.ResolveLocalInformation();
            return(runReport);
        }
Пример #16
0
        public void GameEnd(Domain.Game game,
                            Player winner = null,
                            GameResultType gameResultType = GameResultType.NotDefined)
        {
            var gameEndTimestampQuery = $"UPDATE [{Table.Games}] SET [{Column.EndTimestamp}] = '{DateTime.Now}' " +
                                        $"WHERE [Id] = {game.Id}";

            ExecuteNonQueryInternal(gameEndTimestampQuery);

            if (gameResultType == GameResultType.Aborted ||
                gameResultType == GameResultType.Error)
            {
                StatisticUpdateAllPlayersSetGameResultAbortedOrError(game.Id, gameResultType);
            }
            else if (winner != null)
            {
                StatisticUpdateAllPlayersSetGameResultForWinnersAndLosers(game.Id, winner.Id);
            }
        }
Пример #17
0
        public static string GetColor(GameResultType gameResultType)
        {
            switch (gameResultType)
            {
            case GameResultType.Expectation:
                return("#6c757d");

            case GameResultType.Win:
                return("#28a745");

            case GameResultType.Defeat:
                return("#dc3545");

            case GameResultType.RefundOrCancellation:
                return("#ffc107");

            default:
                return("#343a40");
            }
        }
 private void Run_OnServerGameOver(Run run, GameResultType gameResultType)
 {
     if (gameResultType == GameResultType.Unknown || gameResultType == GameResultType.Won)
     {
         float multiplier = difconfigs[(int)run.selectedDifficulty];
         float lunarcoins = (run.stageClearCount * multiplier) - 5f;
         if (lunarcoins > 0)
         {
             uint totalcoins = Convert.ToUInt32(Math.Ceiling(lunarcoins));
             for (int i = 0; i < NetworkUser.readOnlyInstancesList.Count; i++)
             {
                 NetworkUser networkUser = NetworkUser.readOnlyInstancesList[i];
                 if (networkUser && networkUser.isParticipating)
                 {
                     networkUser.AwardLunarCoins(totalcoins);
                 }
             }
         }
     }
 }
Пример #19
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="team">Team</param>
 /// <param name="opponent">Team</param>
 /// <param name="teamPF">int</param>
 /// <param name="oppPF">int</param>
 /// <param name="isHomeGame">bool</param>
 public GameResult(Team opponent, int teamPF, int oppPF, bool isHomeGame)
 {
     this.opponent   = opponent;
     this.teamPF     = teamPF;
     this.oppPF      = oppPF;
     this.isHomeGame = isHomeGame;
     if (teamPF > oppPF)
     {
         gameResultType = GameResultType.Win;
     }
     else if (oppPF > teamPF)
     {
         gameResultType = GameResultType.Loss;
     }
     else
     {
         gameResultType = GameResultType.Tie;
     }
     SetName();
 }
Пример #20
0
        public static string GetCssClassForTable(GameResultType gameResultType)
        {
            switch (gameResultType)
            {
            case GameResultType.Expectation:
                return("");

            case GameResultType.Win:
                return("table-success");

            case GameResultType.Defeat:
                return("table-danger");

            case GameResultType.RefundOrCancellation:
                return("table-warning");

            default:
                return("");
            }
        }
Пример #21
0
        private decimal CalculateResult(decimal betValue, GameResultType forecastGameResultType,
                                        double forecastCoefficient)
        {
            switch (forecastGameResultType)
            {
            case GameResultType.Expectation:
                return(betValue);

            case GameResultType.Win:
                return(betValue * (decimal)forecastCoefficient);

            case GameResultType.Defeat:
                return(betValue * -1);

            case GameResultType.RefundOrCancellation:
                return(betValue);

            default:
                throw new ArgumentOutOfRangeException(nameof(forecastGameResultType), forecastGameResultType, null);
            }
        }
Пример #22
0
    public void TriggerGameResult(GameResultType result)
    {
        Debug.Log("Trigger Game Result : " + result.ToString());

        catPageManager = Instantiate(catPageManagerPrefab);

        catPageManager.SetResoucre(gameResultSources.Home_Cat_Clip, gameResultSources.Go_Cat_Clip, gameResultSources.Error_Cat_Clip, gameResultSources.NextScene);
        switch (result)
        {
        case GameResultType.Finished:

            if (gameResultSources.gameFinishEventType == GameFinishEventType.Home)
            {
                catPageManager.SetGoCatPageInfo(GoCatPageManager.GoCatType.AlphaBG_Cat_HomeBtn);
            }
            else if (gameResultSources.gameFinishEventType == GameFinishEventType.NextSceneInstantly)
            {
                Debug.Log("直接進到下一關囉");
                SceneManager.LoadScene(gameResultSources.NextScene);
            }



            break;

        case GameResultType.Fail:

            if (gameResultSources != null)
            {
                if (gameResultSources.gameFailEventType == GameFailEventType.ClickGoToReload)
                {
                    catPageManager.SetGoCatPageInfo(GoCatPageManager.GoCatType.NotBG_Cat_GoBtn);
                }
            }

            break;
        }
    }
Пример #23
0
    private void HandleDoTurn(int x, int y)
    {
        if (_boardData.Cells[x, y].cellOwner == CellOwner.None)
        {
            _boardData.SetCellOwner(x, y, _firstPlayerTurn ? CellOwner.First : CellOwner.Second);
        }

        _first.OnDoTurn  -= HandleDoTurn;
        _second.OnDoTurn -= HandleDoTurn;

        if (CheckEndGame())
        {
            GameResultType = ReversiRules.GetGameResultType(_boardData.Cells);
            GameEvents.Instance.SendEndGame();
            return;
        }

        if (ReversiRules.GetPossibleTurns(_boardData.Cells, !_firstPlayerTurn).Count > 0)
        {
            _firstPlayerTurn = !_firstPlayerTurn;
        }

        StartTurn();
    }
Пример #24
0
        private void Run_OnServerGameOver(Run arg1, GameResultType arg2)
        {
            var t = Time.time;

            foreach (KeyValuePair <Int32, List <Int32> > kv in this.bodyHistory)
            {
                base.Logger.LogWarning(kv.Key.ToString());
                foreach (QueryInfo q in this.queries)
                {
                    var context = new QueryContext
                    {
                        curTime      = t,
                        maxTime      = t,
                        minTime      = t,
                        runningTotal = 0f
                    };

                    foreach (Int32 body in kv.Value)
                    {
                        if (this.damageStamps.ContainsKey(body))
                        {
                            foreach (DamageStamp stamp in this.damageStamps[body])
                            {
                                if (!q.condition(context, stamp))
                                {
                                    continue;
                                }
                                context = q.addDamageEnd(context, stamp);
                            }
                        }
                    }

                    base.Logger.LogInfo(q.prefix + q.calcDamageEnd(context));
                }
            }
        }
Пример #25
0
        private void StatisticUpdateAllPlayersSetGameResultAbortedOrError(int gameId, GameResultType gameResultType)
        {
            var playersGameStatisticsResultQuery = $"UPDATE [{Table.Statistic}] SET [{Column.GameResult}] = {(int) gameResultType} " +
                                                   $"WHERE [{Column.Id}] IN (SELECT [{Column.Id}] FROM [{Table.Statistic}] AS [S] " +
                                                   $"INNER JOIN [{Table.GameStatistic}] AS [GS] " +
                                                   $"ON [GS].[{Column.Game}] = {gameId} " +
                                                   $"AND [GS].[{Column.Statistic}] = [S].[{Column.Id}])";

            ExecuteNonQueryInternal(playersGameStatisticsResultQuery);
        }
Пример #26
0
 public void Remove(GameResultType result)
 {
     results.Remove(result);
 }
Пример #27
0
        private void OnServerGameOver(Run arg1, GameResultType arg2)
        {
            Logger.LogError($"====================================== CLEAR");

            Players.Clear();
        }
Пример #28
0
        private void Run_BeginGameOver(On.RoR2.Run.orig_BeginGameOver orig, Run self, GameResultType gameResultType)
        {
            On.RoR2.Run.Update -= Run_Update;

            Time.timeScale = 1.0f;

            orig.Invoke(self, gameResultType);
        }
Пример #29
0
 public TicTacToeResult(GameResultType type, string winnerName, string winningCoordinates)
 {
     Type               = type;
     WinnerName         = winnerName;
     WinningCoordinates = winningCoordinates;
 }