Beispiel #1
0
        public bool UpdateMapStatistic(Data.StatisticData Statistic, byte Map, sbyte Score, uint MaxPang)
        {
            var query = $" Exec dbo.ProcUpdateMapStatistics @UID = '{GetUID}', @MAP ='{Map}',@DRIVE = '{Statistic.Drive}', @PUTT = '{Statistic.Putt}', @HOLE = '{Statistic.Hole}',  @FAIRWAY = '{Statistic.Fairway}', @HOLEIN = '{Statistic.Holein}', @PUTTIN = '{Statistic.Puttin}', @TOTALSCORE = '{Score}',  @BESTSCORE = '{Score}',  @MAXPANG = '{MaxPang}',  @CHARTYPEID = '{this.Inventory.GetCharTypeID()}',  @ASSIST = '{this.Assist}'";

            var IsNewRecord = Db.Database.SqlQuery <int>(query).FirstOrDefault();

            return(IsNewRecord == 1);
        }
Beispiel #2
0
 public DataGame Initial()
 {
     Statistic          = new StatisticData();
     Reward             = new TGameReward();
     Pang               = 0;
     BonusPang          = 0;
     Score              = 0;
     ParCount           = 0;
     ShotCount          = 0;
     TotalShot          = 1; // { Total shot default is 1 }
     EXP                = 0;
     HoleComplete       = false;
     HoleCompletedCount = 0;
     Reward.Initial();
     Quited = false;
     Rate   = 0;
     return(this);
 }
Beispiel #3
0
 public void LoadStatistic()
 {
     foreach (var Data in Db.ProcGetStatistic((int)GetUID))
     {
         UserStatistic = new Data.StatisticData()
         {
             Drive           = (uint)Data.Drive,
             Putt            = (uint)Data.Putt,
             PlayTime        = (uint)Data.Playtime,
             ShotTime        = (uint)Data.ShotTime,
             LongestDistance = Data.Longest,
             Pangya          = (uint)Data.Pangya,
             TimeOut         = (uint)Data.Timeout,
             OB            = (uint)Data.OB,
             DistanceTotal = (uint)Data.Distance,
             Hole          = (uint)Data.Hole,
             TeamHole      = (uint)Data.TeamHole,
             HIO           = (uint)Data.Holeinone,
             Bunker        = (ushort)Data.Bunker,
             Fairway       = (uint)Data.Fairway,
             Albratoss     = (uint)Data.Albatross,
             Holein        = (uint)Data.Holein,
             Puttin        = (uint)Data.PuttIn,
             LongestPutt   = Data.LongestPuttin,
             LongestChip   = Data.LongestChipIn,
             EXP           = (uint)Data.Game_Point,
             Level         = (byte)Data.Game_Level,
             Pang          = (ulong)Data.Pang,
             TotalScore    = (uint)Data.TotalScore,
             Score         = new byte[5] {
                 (byte)Data.BestScore0, (byte)Data.BestScore1, (byte)Data.BestScore2, (byte)Data.BestScore3, (byte)Data.BESTSCORE4
             },
             Unknown           = 0,
             MaxPang0          = (ulong)Data.MaxPang0,
             MaxPang1          = (ulong)Data.MaxPang1,
             MaxPang2          = (ulong)Data.MaxPang2,
             MaxPang3          = (ulong)Data.MaxPang3,
             MaxPang4          = (ulong)Data.MaxPang4,
             SumPang           = (ulong)Data.SumPang,
             GamePlayed        = (uint)Data.GameCount,
             Disconnected      = (uint)Data.DisconnectGames,
             TeamWin           = (uint)Data.wTeamWin,
             TeamGame          = (uint)Data.wTeamGames,
             LadderPoint       = (uint)Data.LadderPoint,
             LadderWin         = (uint)Data.LadderWin,
             LadderLose        = (uint)Data.LadderLose,
             LadderDraw        = (uint)Data.LadderDraw,
             LadderHole        = (uint)Data.LadderHole,
             ComboCount        = (uint)Data.ComboCount,
             MaxCombo          = (uint)Data.MaxComboCount,
             NoMannerGameCount = (uint)Data.NoMannerGameCount,
             SkinsPang         = (ulong)Data.SkinsPang,
             SkinsWin          = (uint)Data.SkinsWin,
             SkinsLose         = (uint)Data.SkinsLose,
             SkinsRunHole      = (uint)Data.SkinsRunHoles,
             SkinsStrikePoint  = (uint)Data.SkinsStrikePoint,
             SKinsAllinCount   = (uint)Data.SkinsAllinCount,
             Unknown1          = new byte[6] {
                 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
             },
             GameCountSeason = (uint)Data.GameCountSeason,
             Unknown2        = new byte[8] {
                 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
             }
         };
     }
 }
Beispiel #4
0
        public static StatisticData operator +(StatisticData Left, StatisticData Right)
        {
            var Result = new StatisticData()
            {
                //{ Drive }
                Drive = Left.Drive + Right.Drive,
                //{ Putt}
                Putt = Left.Putt + Right.Putt,
                //{ Player Time Do Nothing }
                PlayTime = Left.PlayTime,
                //{ Shot Time }
                ShotTime = Left.ShotTime + Right.ShotTime
            };

            //{ Longest }
            if (Right.LongestDistance > Left.LongestDistance)
            {
                Result.LongestDistance = Right.LongestDistance;
            }
            else
            {
                Result.LongestDistance = Left.LongestDistance;
            }
            //{ Hit Pangya }
            Result.Pangya = Left.Pangya + Right.Pangya;
            //{ Timeout }
            Result.TimeOut = Left.TimeOut;
            //{ OB }
            Result.OB = Left.OB + Right.OB;
            //{ Total Distance }
            Result.DistanceTotal = Left.DistanceTotal + Right.DistanceTotal;
            //{ Hole Total }
            Result.Hole = Left.Hole + Right.Hole;
            //{ Team Hole }
            Result.TeamHole = Left.TeamHole;
            //{ Hole In One }
            Result.HIO = Left.HIO;
            //{ Bunker }
            Result.Bunker = (ushort)(Left.Bunker + Right.Bunker);
            //{ Fairway }
            Result.Fairway = Left.Fairway + Right.Fairway;
            //{ Albratoss }
            Result.Albratoss = Left.Albratoss + Right.Albratoss;
            //{ Holein ? }
            Result.Holein = Left.Holein + (Result.Hole - Right.Holein);
            //{ Puttin }
            Result.Puttin = Left.Puttin + Right.Puttin;
            //{ Longest Putt }
            if (Right.LongestPutt > Left.LongestPutt)
            {
                Result.LongestPutt = Right.LongestPutt;
            }
            else
            {
                Result.LongestPutt = Left.LongestPutt;
            }
            //{ Longest Chip }
            if (Right.LongestChip > Left.LongestChip)
            {
                Result.LongestChip = Right.LongestChip;
            }
            else
            {
                Result.LongestChip = Left.LongestChip;
            }
            return(Result);
        }