private void CheckPogbaGoal(tnGoalEventParams i_Params)
    {
        if (!i_Params.hasValidScorer)
        {
            return;
        }

        int scorerId = i_Params.scorerId;

        if (scorerId == s_PogbaHashedId)
        {
            bool humanScorer = i_Params.isHumanScorer;
            bool isLocal     = i_Params.isLocalScorer;

            if (humanScorer && isLocal)
            {
                StatsModule statsModule = GameServices.GetModuleMain <StatsModule>();
                if (statsModule != null)
                {
                    statsModule.UpdateIntStat(tnUserStatsId.s_PogbaStatId, 1, IntStatUpdateFunction.Add);
                    statsModule.StoreStats();
                }
            }
        }
    }
    private void OnMatchEnded(tnEndMatchEventParams i_Params)
    {
        if (!IsValidMatch(i_Params))
        {
            return;
        }

        StatsModule statsModule = GameServices.GetModuleMain <StatsModule>();

        if (statsModule == null)
        {
            return;
        }

        statsModule.UpdateIntStat(tnUserStatsId.s_MatchesPlayedStatId, 1, IntStatUpdateFunction.Add);

        if (i_Params.hasReferee)
        {
            statsModule.UpdateIntStat(tnUserStatsId.s_MatchesPlayedWithRefereeStatId, 1, IntStatUpdateFunction.Add);
        }

        int minSufferedGoals = GetMinSufferedGoals(i_Params);
        int maxScoredGoals   = GetMaxScoredGoals(i_Params);

        statsModule.UpdateIntStat(tnUserStatsId.s_MinSuffuredGoalsStatId, minSufferedGoals, IntStatUpdateFunction.Min);
        statsModule.UpdateIntStat(tnUserStatsId.s_MaxScoredGoalsStatId, maxScoredGoals, IntStatUpdateFunction.Max);

        bool result71 = (i_Params.scoreA == 7 && i_Params.scoreB == 1 && i_Params.teamAHumanPlayers > 0 && i_Params.isTeamALocal) || (i_Params.scoreA == 1 && i_Params.scoreB == 7 && i_Params.teamBHumanPlayers > 0 && i_Params.isTeamBLocal);

        statsModule.UpdateBoolStat(tnUserStatsId.s_Result71StatId, result71, BoolStatUpdateFunction.Add);

        bool realPool = (i_Params.ballId == s_Ball8Id && i_Params.stadiumId == s_PoolPalaceHashedId);

        statsModule.UpdateBoolStat(tnUserStatsId.s_RealPoolStatId, realPool, BoolStatUpdateFunction.Add);

        bool itaBeatsFrance = (i_Params.teamAId == s_ItaHashedId && i_Params.teamBId == s_FraHashedId && i_Params.teamAHumanPlayers > 0 && i_Params.isTeamALocal && i_Params.scoreA > i_Params.scoreB) ||
                              (i_Params.teamAId == s_FraHashedId && i_Params.teamBId == s_ItaHashedId && i_Params.teamBHumanPlayers > 0 && i_Params.isTeamBLocal && i_Params.scoreB > i_Params.scoreA);

        statsModule.UpdateBoolStat(tnUserStatsId.s_ItaBeatsFranceStatId, itaBeatsFrance, BoolStatUpdateFunction.Add);

        statsModule.StoreStats();
    }
    private void OnMatchStarted(tnStartMatchEventParams i_Params)
    {
        if (!IsValidMatch(i_Params))
        {
            return;
        }

        StatsModule statsModule = GameServices.GetModuleMain <StatsModule>();

        if (statsModule == null)
        {
            return;
        }

        int humanPlayers = i_Params.teamAHumanPlayers + i_Params.teamBHumanPlayers;

        statsModule.UpdateIntStat(tnUserStatsId.s_BiggerTeamSizeStatId, humanPlayers, IntStatUpdateFunction.Max);

        statsModule.StoreStats();
    }