Exemplo n.º 1
0
 public void UpdateiGoldTop(int ID, string UsName, long iGold, int Types)
 {
     //更新排行榜
     BCW.Model.Toplist model = new BCW.Model.Toplist();
     model.Types  = Types;
     model.UsId   = ID;
     model.UsName = UsName;
     if (iGold > 0)
     {
         model.WinNum  = 1;
         model.WinGold = iGold;
     }
     else
     {
         model.PutNum  = 1;
         model.PutGold = iGold;
     }
     if (!new Toplist().Exists(ID, Types))
     {
         new Toplist().Add(model);
     }
     else
     {
         new Toplist().Update(model);
     }
 }
Exemplo n.º 2
0
        public void UpdateiGold(int ID, string UsName, long iGold, int Types)
        {
            //更新用户虚拟币
            string AcText = string.Empty;

            if (Types == 1)
            {
                AcText = "多人石头游戏消费";
            }
            else if (Types == 2)
            {
                AcText = "789游戏消费";
            }
            else if (Types == 3)
            {
                AcText = "猜猜乐游戏消费";
            }
            else if (Types == 4)
            {
                AcText = "幸运28游戏消费";
            }
            else if (Types == 5)
            {
                AcText = "虚拟投注游戏消费";
            }
            else if (Types == 6)
            {
                AcText = "疯狂彩球消费";
            }
            else if (Types == 7)
            {
                AcText = "疯狂吹牛消费";
            }
            else if (Types == 8)
            {
                AcText = "猜拳消费";
            }
            else if (Types == 9)
            {
                AcText = "大小庄消费";
            }
            else if (Types == 10)
            {
                AcText = "掷骰消费";
            }
            else if (Types == 11)
            {
                AcText = "时时彩消费";
            }
            else if (Types == 22)
            {
                AcText = "新快3消费";
            }
            else if (Types == 25)
            {
                AcText = "快乐扑克3消费";
            }
            else if (Types == 26)
            {
                AcText = "捕鱼消费";
            }

            UpdateiGold(ID, UsName, iGold, AcText);
            //更新排行榜
            BCW.Model.Toplist model = new BCW.Model.Toplist();
            model.Types  = Types;
            model.UsId   = ID;
            model.UsName = UsName;
            if (iGold > 0)
            {
                model.WinNum  = 1;
                model.WinGold = iGold;
            }
            else
            {
                model.PutNum  = 1;
                model.PutGold = iGold;
            }
            if (!new Toplist().Exists(ID, Types))
            {
                new Toplist().Add(model);
            }
            else
            {
                new Toplist().Update(model);
            }
        }
Exemplo n.º 3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(BCW.Model.Toplist model)
 {
     return(dal.Add(model));
 }
Exemplo n.º 4
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(BCW.Model.Toplist model)
 {
     dal.Update(model);
 }
Exemplo n.º 5
0
    private void PlayBigSmallInfo(int meid, int id, long PayCent)
    {
        ChanageOnline(meid);
        string mename = new BCW.BLL.User().GetUsName(meid);

        BCW.Model.Game.Bslist model = new BCW.BLL.Game.Bslist().GetBslist(id);
        if (model.UsID == meid)
        {
            Response.End();
        }

        int bet = new Random().Next(0, 2);

        if (PayCent < model.SmallPay || PayCent > model.BigPay)
        {
            Response.End();
        }
        if (PayCent > model.Money)
        {
            Response.End();
        }

        long   gold   = 0;
        string bzText = string.Empty;

        if (model.BzType == 0)
        {
            bzText = ub.Get("SiteBz");
            gold   = new BCW.BLL.User().GetGold(meid);
        }
        else
        {
            bzText = ub.Get("SiteBz2");
            gold   = new BCW.BLL.User().GetMoney(meid);
        }
        if (gold < PayCent)
        {
            //更新消费记录
            BCW.Model.Goldlog modelx = new BCW.Model.Goldlog();
            modelx.BbTag     = 3;
            modelx.Types     = model.BzType;
            modelx.PUrl      = Utils.getPageUrl();//操作的文件名
            modelx.UsId      = meid;
            modelx.UsName    = mename;
            modelx.AcGold    = 500000;
            modelx.AfterGold = gold + 500000;//更新后的币数
            modelx.AcText    = "系统机器人自动操作";
            modelx.AddTime   = DateTime.Now;
            new BCW.BLL.Goldlog().Add(modelx);
            if (model.BzType == 0)
            {
                BCW.Data.SqlHelper.ExecuteSql("Update tb_User set iGold=iGold+500000 where id=" + meid + "");
            }
            else
            {
                BCW.Data.SqlHelper.ExecuteSql("Update tb_User set iMoney=iMoney+500000 where id=" + meid + "");
            }
        }

        bool   IsWin  = false;
        Random ra     = new Random(unchecked ((int)DateTime.Now.Ticks));
        int    rdNext = ra.Next(0, 2);

        if (rdNext == bet)
        {
            IsWin = true;
        }

        //客家十赌六赢
        string IsWinBot = ub.GetSub("BsIsWinBot", xmlPath);

        if (IsWinBot == "0")
        {
            rdNext = ra.Next(1, 1000);
            if (rdNext <= 400)
            {
                rdNext = ((bet == 0) ? 1 : 0);
                IsWin  = false;
            }
            else
            {
                rdNext = bet;
                IsWin  = true;
            }
        }

        long WinCent = 0;

        if (IsWin)//闲胜
        {
            double XTar   = Convert.ToDouble(ub.GetSub("BsXTar", xmlPath));
            long   xMoney = PayCent - Convert.ToInt64(XTar * 0.01 * PayCent);
            if (model.BzType == 0)
            {
                //更新排行榜
                BCW.Model.Toplist modeltop = new BCW.Model.Toplist();
                modeltop.Types  = 9;
                modeltop.UsId   = model.UsID;
                modeltop.UsName = model.UsName;

                modeltop.PutNum  = 1;
                modeltop.PutGold = -PayCent;

                if (!new BCW.BLL.Toplist().Exists(model.UsID, 9))
                {
                    new BCW.BLL.Toplist().Add(modeltop);
                }
                else
                {
                    new BCW.BLL.Toplist().Update(modeltop);
                }

                new BCW.BLL.User().UpdateiGold(meid, mename, xMoney, 9);
            }
            else
            {
                new BCW.BLL.User().UpdateiMoney(meid, mename, xMoney, "大小庄赢得");
            }

            new BCW.BLL.Game.Bslist().UpdateMoney(id, -PayCent);
            WinCent = xMoney;
        }
        else//庄胜
        {
            double ZTar   = Convert.ToDouble(ub.GetSub("BsZTar", xmlPath));
            long   zMoney = PayCent - Convert.ToInt64(ZTar * 0.01 * PayCent);
            new BCW.BLL.Game.Bslist().UpdateMoney(id, zMoney);
            if (model.BzType == 0)
            {
                //更新排行榜
                BCW.Model.Toplist modeltop = new BCW.Model.Toplist();
                modeltop.Types   = 9;
                modeltop.UsId    = model.UsID;
                modeltop.UsName  = model.UsName;
                modeltop.WinNum  = 1;
                modeltop.WinGold = zMoney;
                if (!new BCW.BLL.Toplist().Exists(model.UsID, 9))
                {
                    new BCW.BLL.Toplist().Add(modeltop);
                }
                else
                {
                    new BCW.BLL.Toplist().Update(modeltop);
                }

                new BCW.BLL.User().UpdateiGold(meid, mename, -PayCent, 9);
            }
            else
            {
                new BCW.BLL.User().UpdateiMoney(meid, mename, -PayCent, "大小庄失去");
            }
            WinCent = -PayCent;
        }

        //写进下注记录
        BCW.Model.Game.Bspay addmodel = new BCW.Model.Game.Bspay();
        addmodel.BsId    = id;
        addmodel.BsTitle = model.Title;
        addmodel.BzType  = model.BzType;
        addmodel.BetType = bet;
        addmodel.PayCent = PayCent;
        addmodel.UsID    = meid;
        addmodel.UsName  = mename;
        addmodel.WinCent = WinCent;
        addmodel.AddTime = DateTime.Now;
        new BCW.BLL.Game.Bspay().Add(addmodel);
        //写进人气
        new BCW.BLL.Game.Bslist().UpdateClick(id);
        //动态
        string wText = string.Empty;

        if (IsWin == true)
        {
            wText = "[url=/bbs/uinfo.aspx?uid=" + meid + "]" + mename + "[/url]在[url=/bbs/game/bigsmall.aspx]大小庄[/url]《" + model.Title + "》赢得了" + PayCent + "" + bzText + "";
        }
        else
        {
            wText = "[url=/bbs/uinfo.aspx?uid=" + meid + "]" + mename + "[/url]在[url=/bbs/game/bigsmall.aspx]大小庄[/url]《" + model.Title + "》失去了" + PayCent + "" + bzText + "";
        }

        new BCW.BLL.Action().Add(13, 0, 0, "", wText);
    }