Пример #1
0
        /// <summary>
        /// 判断是否有足够的积分来玩游戏
        /// </summary>
        /// <param name="gameNo"></param>
        public bool IsEnoughScoreToPlay(string gameNo, string userID)
        {
            TGameApp gameApp = new TGameApp();

            TGameEntity entity  = gameApp.GetForm(gameNo);
            JObject     setting = NFine.Code.Json.ToJObject(entity.F_Setting);

            bool isTrue = false;

            if (Session["LBOrLoveBird"].ToString() == "LB")//用LB进行游戏
            {
                isTrue = CommonTools.CheckPlayerCoinToGame(setting["LowestPlayLB"].ToString(), userID, "2");
                if (!isTrue)
                {
                    Response.Write("<html><head><title>系统提示</title><script>alert('您的" + Session["LBOrLoveBird"] + "积分余额不足,至少需要" + setting["LowestPlayLB"].ToString() + "个,请充值'); history.go(-1);</script></head><body></body></html>");
                    Response.End();
                }
            }
            else
            {
                isTrue = CommonTools.CheckPlayerCoinToGame(setting["LowestPlayLoveBird"].ToString(), userID, "1");
                if (!isTrue)
                {
                    Response.Write("<html><head><title>系统提示</title><script>alert('您的" + Session["LBOrLoveBird"] + "积分余额不足,至少需要" + setting["LowestPlayLoveBird"].ToString() + "个,请充值');history.go(-1);</script></head><body></body></html>");
                    Response.End();
                }
            }

            return(isTrue);
        }
Пример #2
0
        /// <summary>
        /// 扣除入场分操作
        /// </summary>
        /// <param name="gameNo"></param>
        /// <param name="uID"></param>
        public void PayScoreForBeginGame(string gameNo, string uID)
        {
            string      userId   = uID;
            string      gameName = "";
            string      comeSum  = "";
            string      type     = "";
            TGameApp    gameApp  = new TGameApp();
            TGameEntity entity   = gameApp.GetForm(gameNo);
            JObject     setting  = NFine.Code.Json.ToJObject(entity.F_Setting);

            comeSum = "-" + setting["PlayLBPay"].ToString().Trim();
            if (gameNo == "2")
            {
                gameName = "H5-看你有多色-扣除入场分" + comeSum;
            }
            if (gameNo == "3")
            {
                gameName = "H5-消消看-扣除入场分" + comeSum;
            }
            if (gameNo == "4")
            {
                gameName = "H5-扫雷-扣除入场分" + comeSum;
            }
            if (gameNo == "5")
            {
                gameName = "H5-美女拼图-扣除入场分" + comeSum;
            }
            if (gameNo == "6")
            {
                gameName = "H5-疯狂算术-扣除入场分" + comeSum;
            }
            type = "2";

            if (!CommonTools.GiveCoinToPlayer(userId, comeSum, type, gameName))
            {
                Response.Write("<html><head><title>系统提示</title><script>alert('网络连接失败,或者您的积分不足,请检查!'); history.go(-1);</script></head><body></body></html>");
                Response.End();
            }
        }
Пример #3
0
 public override void InitTemplate(BaseTemplate tmpl)
 {
     base.InitTemplate(tmpl);
     template = tmpl as TGameApp;
 }