/********************************
 *
 * 作者:吴隆健
 * 创建时间: 2019/7/3 15:00:59
 * 
 ********************************/

using System;
using System.Data;
using Server.DB.Sql;
using GameData;
using MrWu.Debug;
using System.Threading.Tasks;
using MrWu.Basic;
using System.Data.SqlClient;

namespace GameDAL.Game {

    /// <summary>
    /// 
    /// </summary>
    public static class PlayerDB {
        
        /// <summary>
        /// 读取玩家数据——存储过程
        /// </summary>
        private static string Fun_ReeadPlayerData2025 = "ReadPlayerData2025";
        
        /// <summary>
        /// 保存玩家数据——存储过程
        /// 增加比赛卷逻辑 2021年6月8日11:15:15
        /// </summary>
        private static string Fun_SavePlayerData = "SavePlayerData_Roll2023";//"SavePlayerData";

        /// <summary>
        /// 读取玩家数据
        /// </summary>
        public static DataSet ReadPlayerData(int userid, bool hasPi) {
            var sql = GameDB.Instance.BeginSetProcedureParameter(dbbase.gamedb, Fun_ReeadPlayerData2025);
            GameDB.Instance.AddProdureParameters(sql, "@userid", SqlDbType.Int, userid);
            GameDB.Instance.AddProdureParameters(sql, "@hasPi", SqlDbType.Int, hasPi ? 1 : 0);

            DataSet ds = new DataSet();
            GameDB.Instance.EndAddProdureParameters(sql, ds);
            return ds;
        }

        /// <summary>
        /// 保存玩家数据
        /// </summary>
        /// <param name="pdc">玩家变化的数据</param>
        /// <returns>返回值</returns>
        public static bool SavePlayerData(PlayerDataChange pdc)
        {

            return true;
        }
    }
}
