コード例 #1
0
    // 获得当期奖池结余
    private long NextPrize(int resultCID)
    {
        long nowprize = new BCW.SFC.BLL.SfList().nowprize(resultCID);
        //获取已经派出奖金
        long _Price         = new BCW.SFC.BLL.SfPay().AllWinCentbyCID(resultCID);
        long sysprizeshouxu = Convert.ToInt64(nowprize * Convert.ToInt64(ub.GetSub("SFsys", "/Controls/SFC.xml")) * 0.01);
        long Prices         = nowprize - _Price - sysprizeshouxu;//当期结余=当期奖池-当期系统收取-当期派奖

        return(Prices);
    }
コード例 #2
0
    //机器人兑奖
    public void RobotCase()
    {
        string sfc       = ub.GetSub("SFName", xmlPath);
        string RoBot     = ub.GetSub("RoBotID", xmlPath);
        string RoBotCost = ub.GetSub("ReBotCost", xmlPath);

        string[] RoBotID = RoBot.Split('#');
        int      meid    = 0;

        for (int i = 0; i < RoBotID.Length; i++)
        {
            meid = Convert.ToInt32(RoBotID[i]);
            DataSet model2 = new BCW.SFC.BLL.SfPay().GetList("id", "usID=" + meid + " and IsSpier=1 and WinCent > 0 and State!=2 ");
            if (model2 != null && model2.Tables[0].Rows.Count > 0)
            {
                for (int i2 = 0; i2 < model2.Tables[0].Rows.Count; i2++)
                {
                    int pid = 0;
                    try
                    {
                        pid = Convert.ToInt32(model2.Tables[0].Rows[0][i2]);
                    }
                    catch { }
                    if (new BCW.SFC.BLL.SfPay().ExistsReBot(pid, meid))
                    {
                        if (new BCW.SFC.DAL.SfPay().getState(pid) != 2)
                        {
                            //new BCW.SFC.BLL.SfPay().RoBotByID(pid);
                            //操作币
                            BCW.SFC.Model.SfPay model = new BCW.SFC.BLL.SfPay().GetSfPay(pid);
                            long winMoney             = Convert.ToInt64(model.WinCent);
                            int  number = new BCW.SFC.BLL.SfPay().GetCID(pid);
                            if (model.IsPrize == 10)
                            {
                                new BCW.BLL.User().UpdateiGold(meid, winMoney, "" + sfc + "兑奖-期号-" + number + "-标识ID" + pid + "(" + model.change + "奖)");
                            }
                            else
                            {
                                new BCW.BLL.User().UpdateiGold(meid, winMoney, "" + sfc + "兑奖-期号-" + number + "-标识ID" + pid + "(" + model.IsPrize + "等奖)");
                            }
                            new BCW.SFC.BLL.SfPay().UpdateState(pid);
                            builder.Append("机器人" + meid + "自动兑奖!ok1<br />");
                        }
                    }
                }
            }
        }
    }
コード例 #3
0
    // 获得奖池币
    private long AllPrize(int resultCID)
    {
        //获取当前期数投注总额
        long AllPrice = new BCW.SFC.BLL.SfPay().AllPrice(resultCID);
        //获取已经派出奖金
        long _Price = new BCW.SFC.BLL.SfPay().AllWinCentbyCID(resultCID);
        //获取当前期数系统投注总额
        //long SysPrice = new BCW.SFC.BLL.SfJackpot().SysPrice();
        long Sysprize = new BCW.SFC.DAL.SfList().getsysprize(resultCID);
        //获取当期系统投注状态
        int Sysprizestatue = new BCW.SFC.DAL.SfList().getsysprizestatue(resultCID);
        //获取上一期滚存下来的奖池
        int lastcid = 0;

        if (new BCW.SFC.BLL.SfList().ExistsCID(resultCID - 1))
        {
            lastcid = (resultCID - 1);
        }
        else
        {
            lastcid = LastOpenCID();
        }
        long Nextprize = new BCW.SFC.DAL.SfList().getnextprize(lastcid);

        //获取当前期数系统回收总额
        long SysWin = new BCW.SFC.BLL.SfJackpot().SysWin(resultCID);
        //奖池总额
        long Prices = 0;

        if (Sysprizestatue == 3 || Sysprizestatue == 1)
        {
            Prices = (AllPrice + Nextprize + Sysprize);
        }
        else
        {
            Prices = (AllPrice + Nextprize);
        }
        return(Prices);
    }
コード例 #4
0
    //机器人ROBOT
    public void Robot()
    {
        string xml      = ub.GetSub("IsBot", xmlPath);
        int    buycount = int.Parse(ub.GetSub("RoBotCount", xmlPath)); //次数
        string buycost  = ub.GetSub("RoBotCost", xmlPath);             //倍数

        if (xml == "1")
        {
            string   RoBot   = ub.GetSub("RoBotID", xmlPath);
            string[] RoBotID = RoBot.Split('#');
            int      n       = RoBot.Split('#').Length;

            Random rr = new Random();
            int    aa = 0;
            aa = rr.Next(0, n);
            string ss   = RoBotID[aa];
            int    usID = Convert.ToInt32(ss);
            ChanageOnline(Convert.ToInt32(RoBotID[aa]));

            string mename = new BCW.BLL.User().GetUsName(usID);//用户姓名

            //未开奖当前投注期号
            DataSet  ds1     = new BCW.SFC.BLL.SfList().GetList("TOP 1 CID", "State=0 order by CID ASC");
            int      CID     = 0;
            DateTime AddTime = DateTime.Now;

            try
            {
                CID = int.Parse(ds1.Tables[0].Rows[0][0].ToString());
            }
            catch
            {
            }

            BCW.SFC.Model.SfList mod = new BCW.SFC.BLL.SfList().GetSfList1(CID);
            if (mod.Sale_StartTime < DateTime.Now && mod.EndTime > DateTime.Now)
            {
                //计数出该机器人投注的次数是否大于xml限定次数
                int countrebot = new BCW.SFC.BLL.SfPay().GetSFCRobotCount("usID=" + usID + " and IsSpier=1 and CID=" + CID + "");
                if (countrebot <= buycount)
                {
                    long     bei  = 0;
                    string[] ppp  = buycost.Split('#');
                    Random   ranm = new Random();
                    int      k    = ranm.Next(0, (ppp.Length));
                    bei = Convert.ToInt32(ppp[k]);

                    long   Price1  = Utils.ParseInt64(ub.GetSub("SFmallPay", xmlPath)) * bei;
                    string SFprice = ub.GetSub("SFprice", xmlPath);

                    //是否刷屏
                    long   small   = Convert.ToInt64(ub.GetSub("SFmallPay", xmlPath));
                    long   big     = Convert.ToInt64(ub.GetSub("SFBigPay", xmlPath));
                    string appName = "SFC";
                    int    Expir   = Utils.ParseInt(ub.GetSub("SFExpir", xmlPath));//5
                    //BCW.User.Users.IsFresh(appName, Expir);


                    string GameName = ub.GetSub("SFName", xmlPath);
                    //个人每期限投
                    long xPrices = 1;
                    xPrices = Utils.ParseInt64(ub.GetSub("SFCprice", xmlPath));

                    Random ran      = new Random();
                    int[]  a        = new int[] { 0, 1, 3 };
                    string votenum1 = string.Empty;
                    string votenum  = string.Empty;
                    string s        = string.Empty;
                    for (int j = 0; j < 14; j++)
                    {
                        s         = a[ran.Next(0, 3)].ToString();
                        votenum1 += s + ",";
                    }
                    votenum = votenum1;//得到随机投注

                    //支付安全提示
                    string[] p_pageArr = { "CID", "Price", "bei", "Price1", "votenum", "ptype", "act", "info" };
                    long     gold      = new BCW.BLL.User().GetGold(usID);

                    if (gold < Price1)
                    {
                        builder.Append("您的" + ub.Get("SiteBz") + "不足购买此下注");
                    }
                    if (gold < 0)
                    {
                        builder.Append("您的" + ub.Get("SiteBz") + "不足");
                    }
                    if (xPrices > 0)
                    {
                        int     oPrices = 0;
                        DataSet ds      = null;
                        try
                        {
                            ds = new BCW.SFC.BLL.SfPay().GetList("PayCents", "UsID=" + usID + " and CID=" + CID + "");
                        }
                        catch
                        {
                            Utils.Error("!", "");
                        }
                        DataTable dt = ds.Tables[0];
                        foreach (DataRow dr in dt.Rows)
                        {
                            int drs = int.Parse(dr[0].ToString());
                            oPrices = oPrices + drs;
                        }
                        if (oPrices + Price1 > xPrices)
                        {
                            if (oPrices >= xPrices)
                            {
                                Utils.Error("您(" + usID + ")本期下注已达上限,请等待下期...", "");
                            }
                            else
                            {
                                Utils.Error("您(" + usID + ")本期最多还可以下注" + (xPrices - oPrices) + "" + ub.Get("SiteBz") + "", "");
                            }
                        }
                    }
                    if (gold > Price1 && gold > 0 && CID != 0)
                    {
                        BCW.SFC.Model.SfPay modelpay = new BCW.SFC.Model.SfPay();
                        modelpay.usID     = usID;
                        modelpay.Vote     = votenum;              //投注情况
                        modelpay.VoteNum  = 1;                    //投注总数
                        modelpay.IsPrize  = 0;                    //中奖情况
                        modelpay.IsSpier  = 1;                    //机器人为1
                        modelpay.AddTime  = DateTime.Now;
                        modelpay.CID      = CID;                  //期号
                        modelpay.OverRide = Convert.ToInt32(bei); //投注倍率
                        modelpay.PayCents = Price1;               //投注总额
                        modelpay.State    = 0;                    //兑奖
                        modelpay.PayCent  = Convert.ToInt32(ub.GetSub("SFmallPay", xmlPath));
                        modelpay.change   = " ";
                        new BCW.SFC.BLL.SfPay().Add(modelpay);
                        //添加奖池数据
                        BCW.SFC.Model.SfJackpot mo = new BCW.SFC.Model.SfJackpot();
                        mo.usID     = usID;
                        mo.WinPrize = 0;
                        mo.Prize    = Price1;
                        mo.other    = "下注" + Convert.ToString(Price1);
                        mo.allmoney = AllPrize(CID);
                        mo.AddTime  = DateTime.Now;
                        mo.CID      = CID;
                        new BCW.SFC.BLL.SfJackpot().Add(mo);


                        int maxid = new BCW.SFC.BLL.SfPay().GetMaxId(usID);
                        new BCW.BLL.User().UpdateiGold(usID, mename, -Price1, "胜负彩第" + CID + "期投注" + votenum + "标识id" + (maxid - 1));//胜负彩----更新排行榜与扣钱
                        //更新每期下注额度
                        new BCW.SFC.BLL.SfList().UpdatePayCent(new BCW.SFC.BLL.SfPay().PayCents(CID), CID);
                        //更新每期下注数
                        new BCW.SFC.BLL.SfList().UpdatePayCount(new BCW.SFC.BLL.SfPay().VoteNum(CID), CID);
                        string wText = "[url=/bbs/uinfo.aspx?uid=" + usID + "]" + mename + "[/url]在第" + CID + "期[url=/bbs/game/SFC.aspx]" + GameName + "[/url]下注**" + "" + ub.Get("SiteBz") + "";//+ Price1
                        new BCW.BLL.Action().Add(1016, 1, usID, "", wText);
                        Response.Write("<br /><span style='color:red;font-size:20px'>胜负彩机器人正在执行下注任务!</span>");
                    }
                }
                else
                {
                    Response.Write("<br /><span style='color:red;font-size:20px'>胜负彩机器人(" + usID + ")已经完成下注任务!当期下注次数已达上限!</span>");
                }
            }
            else
            {
                Response.Write("<br /><span style='color:red;font-size:20px'>胜负彩机器人未进行下注,等待当期结束,下期开始投注!</span>");
            }
        }
    }