Пример #1
0
    public static void detailInfoForCows(InfoCows info, Dictionary <string, object> data)
    {
        if (info == null || data == null)
        {
            return;
        }

        if (data.ContainsKey("bankerCards")) // 庄家牌型
        {
            DbCowsCard c = BaseJsonSerializer.deserialize <DbCowsCard>(data["bankerCards"].ToString());
            info.createBankerCard(c);
        }
        if (data.ContainsKey("otherCards1")) // 东牌型
        {
            DbCowsCard c = BaseJsonSerializer.deserialize <DbCowsCard>(data["otherCards1"].ToString());
            info.createEastCard(c);
        }
        if (data.ContainsKey("otherCards2")) // 南牌型
        {
            DbCowsCard c = BaseJsonSerializer.deserialize <DbCowsCard>(data["otherCards2"].ToString());
            info.createSouthCard(c);
        }
        if (data.ContainsKey("otherCards3")) // 西牌型
        {
            DbCowsCard c = BaseJsonSerializer.deserialize <DbCowsCard>(data["otherCards3"].ToString());
            info.createWestCard(c);
        }
        if (data.ContainsKey("otherCards4")) // 北牌型
        {
            DbCowsCard c = BaseJsonSerializer.deserialize <DbCowsCard>(data["otherCards4"].ToString());
            info.createNorthCard(c);
        }
    }
Пример #2
0
    // 解析牛牛json串信息
    public static InfoCows parseInfoCows(string exInfo, GMUser user)
    {
        InfoCows info = null;

        try
        {
            DbCowsBet bet = BaseJsonSerializer.deserialize <DbCowsBet>(exInfo);
            if (bet == null)
            {
                return(null);
            }

            info           = new InfoCows();
            info.m_betInfo = bet;

            ObjectId oid = ObjectId.Parse(bet.key);
            Dictionary <string, object> data = DBMgr.getInstance().getTableData(TableName.PUMP_COWS_CARD,
                                                                                "_id",
                                                                                oid,
                                                                                user.getDbServerID(),
                                                                                DbName.DB_PUMP);

            if (data == null)
            {
                return(null);
            }

            detailInfoForCows(info, data);
        }
        catch (System.Exception ex)
        {
        }
        return(info);
    }
Пример #3
0
    // 解析鳄鱼大亨json串信息
    public static InfoCrocodile parseInfoCrocodile(string exInfo)
    {
        InfoCrocodile info = null;

        try
        {
            Dictionary <string, object> dic = BaseJsonSerializer.deserialize <Dictionary <string, object> >(exInfo);
            info = new InfoCrocodile();
            if (dic.ContainsKey("betinfo"))
            {
                info.m_betInfo = BaseJsonSerializer.deserialize <List <BetInfoCrocodile> >(dic["betinfo"].ToString());
            }
            if (dic.ContainsKey("resulttype"))
            {
                info.m_resultType =
                    BaseJsonSerializer.deserialize <List <DbCrocodileResultType> >(dic["resulttype"].ToString());
            }
            if (dic.ContainsKey("resultList"))
            {
                info.m_resultList = BaseJsonSerializer.deserialize <List <DbCrocodileResultList> >(dic["resultList"].ToString());
            }
        }
        catch (System.Exception ex)
        {
        }
        return(info);
    }
Пример #4
0
 public ModelSerializationTests()
 {
     serializer = new DefaultJsonSerializer
     {
         DateFormat = DateFormat,
     };
 }
Пример #5
0
    public override string getDescription(OpInfo info, string str)
    {
        if (info == null)
        {
            return("引用空");
        }

        LogModifyFishlordRoomExpRate param = BaseJsonSerializer.deserialize <LogModifyFishlordRoomExpRate>(str);

        if (param.m_roomList == "")
        {
            return("");
        }

        string[] arrs = Tool.split(param.m_roomList, ',', StringSplitOptions.RemoveEmptyEntries);
        string   room = "";

        for (int i = 0; i < arrs.Length; i++)
        {
            int roomType = Convert.ToInt32(arrs[i]);
            room += StrName.s_roomName[roomType - 1] + ",";
        }

        return(string.Format(info.m_fmt, room, StrName.s_gameName[param.m_gameId]));
    }
Пример #6
0
    // 解析黑红梅方json串信息
    public static InfoShcd parseInfoShcd(string exInfo)
    {
        InfoShcd info = null;

        try
        {
            info = BaseJsonSerializer.deserialize <InfoShcd>(exInfo);
        }
        catch (System.Exception ex)
        {
        }
        return(info);
    }
Пример #7
0
        public void ProcessRequest(HttpContext context)
        {
            RightMgr.getInstance().opCheck(RIGHT.SCORE, context.Session, context.Response);

            GMUser     user  = (GMUser)context.Session["user"];
            ParamScore param = new ParamScore();

            param.m_op    = Convert.ToInt32(context.Request.Form["op"]);
            param.m_toAcc = context.Request.Form["acc"];
            param.m_score = context.Request.Form["param"];
            int targetType = Convert.ToInt32(context.Request.Form["targetType"]);

            if (targetType == AccType.ACC_PLAYER)
            {
                param.scoreToPlayer();
            }
            else
            {
                param.scoreToMgr();
            }

            OpRes  res = user.doDyop(param, DyOpType.opTypeDyOpScore);
            string str = OpResMgr.getInstance().getResultString(res);

            long remainScoreFixBug = -1;

            if (targetType == AccType.ACC_SUPER_ADMIN || targetType == AccType.ACC_SUPER_ADMIN_SUB)
            {
                remainScoreFixBug = 0;
            }
            else
            {
                remainScoreFixBug = ItemHelp.getRemainMoney(param.m_toAcc, targetType == AccType.ACC_PLAYER, user);
            }

            Dictionary <string, object> ret = new Dictionary <string, object>();

            ret.Add("result", (int)res);
            ret.Add("resultInfo", str);

            string rs = (user.m_accType == AccType.ACC_SUPER_ADMIN ||
                         user.m_accType == AccType.ACC_SUPER_ADMIN_SUB) ? "0" : ItemHelp.toStrByComma(ItemHelp.showMoneyValue(user.m_money));

            ret.Add("remainScoreStr", rs);
            ret.Add("remainScore", ItemHelp.showMoneyValue(user.m_money));
            ret.Add("remainScoreFixBug", ItemHelp.showMoneyValue(remainScoreFixBug));
            str = BaseJsonSerializer.genJsonStr(ret);
            context.Response.ContentType = "text/plain";
            context.Response.Write(str);
        }
Пример #8
0
        public void ProcessRequest(HttpContext context)
        {
            RightMgr.getInstance().opCheck("", context.Session, context.Response);

            ParamMaxBetLimit param = new ParamMaxBetLimit();

            param.m_gameId = Convert.ToInt32(context.Request.Form["gameId"]);
            if (param.m_gameId == (int)GameId.fishpark)
            {
                param.m_rateList = context.Request.Form["newValue"];
            }
            else
            {
                param.m_newValue = Convert.ToInt32(context.Request.Form["newValue"]);
            }
            param.m_areaId = Convert.ToInt32(context.Request.Form["areaId"]);
            param.m_op     = Convert.ToInt32(context.Request.Form["op"]);

            GMUser user = (GMUser)context.Session["user"];
            OpRes  res  = user.doDyop(param, DyOpType.opTypeModifyMaxBetLimit);
            string ret  = "";

            if (param.isModify())
            {
                ret  = ((int)res).ToString();
                ret += "@" + OpResMgr.getInstance().getResultString(res);
                ret += "@" + param.m_gameId.ToString();
                ret += "@" + param.m_areaId.ToString();
                if (param.m_gameId == (int)GameId.fishpark)
                {
                    ret += "@" + param.m_rateList;
                }
                else
                {
                    ret += "@" + param.m_newValue.ToString();
                }
            }
            else if (param.isQuery())
            {
                Dictionary <string, object> qresult =
                    (Dictionary <string, object>)user.getSys <DyOpMgr>(SysType.sysTypeDyOp).getDyOp(DyOpType.opTypeModifyMaxBetLimit).getResult();
                ret = BaseJsonSerializer.genJsonStr(qresult);
            }
            else
            {
                ret = OpResMgr.getInstance().getResultString(res);
            }
            context.Response.ContentType = "text/plain";
            context.Response.Write(ret);
        }
Пример #9
0
    // 解析五龙json串信息
    public static InfoDragon parseInfoDragon(string exInfo)
    {
        InfoDragon info = null;

        try
        {
            info = BaseJsonSerializer.deserialize <InfoDragon>(exInfo);
            info.init();
        }
        catch (System.Exception ex)
        {
        }
        return(info);
    }
Пример #10
0
    public override string getDescription(OpInfo info, string str)
    {
        if (info == null)
        {
            return("引用空");
        }

        LogApiApprove param = BaseJsonSerializer.deserialize <LogApiApprove>(str);

        if (param != null)
        {
            return(string.Format(info.m_fmt, param.m_apiAcc, param.m_aliasName));
        }
        return("");
    }
Пример #11
0
    public override string getDescription(OpInfo info, string str)
    {
        if (info == null)
        {
            return("引用空");
        }

        LogCreatePlayer param = BaseJsonSerializer.deserialize <LogCreatePlayer>(str);

        if (param != null)
        {
            return(string.Format(info.m_fmt, param.m_acc));
        }
        return("");
    }
Пример #12
0
    public override string getDescription(OpInfo info, string str)
    {
        if (info == null)
        {
            return("引用空");
        }

        LogResetPwd param = BaseJsonSerializer.deserialize <LogResetPwd>(str);

        if (param != null)
        {
            return(string.Format(info.m_fmt, param.m_acc, param.m_phone));
        }
        return("");
    }
Пример #13
0
    public override string getDescription(OpInfo info, string str)
    {
        if (info == null)
        {
            return("引用空");
        }

        LogFreezeHead param = BaseJsonSerializer.deserialize <LogFreezeHead>(str);

        if (param != null)
        {
            return(string.Format(info.m_fmt, param.m_playerId));
        }
        return("");
    }
Пример #14
0
    public override string getDescription(OpInfo info, string str)
    {
        if (info == null)
        {
            return("引用空");
        }

        LogReloadTable param = BaseJsonSerializer.deserialize <LogReloadTable>(str);

        if (param != null)
        {
            return(string.Format(info.m_fmt,
                                 StrName.s_gameName[param.m_gameId]));
        }
        return("");
    }
        public void ProcessRequest(HttpContext context)
        {
            RightMgr.getInstance().opCheck("", context.Session, context.Response);

            ParamAPISetLimit param = new ParamAPISetLimit();

            param.m_gameId   = Convert.ToInt32(context.Request.Form["gameId"]);
            param.m_apiAcc   = Convert.ToString(context.Request.Form["acc"]);
            param.m_setLimit = Convert.ToInt32(context.Request.Form["value"]);
            param.m_roomId   = Convert.ToInt32(context.Request.Form["roomId"]);
            param.m_op       = Convert.ToInt32(context.Request.Form["op"]);

            GMUser user = (GMUser)context.Session["user"];
            OpRes  res  = user.doDyop(param, DyOpType.opTypeModifyAPISetLimit);
            string ret  = OpResMgr.getInstance().getResultString(res);

            switch (param.m_op)
            {
            case 0:
            {
                Dictionary <string, object> data = new Dictionary <string, object>();
                data.Add("gameId", param.m_gameId);
                data.Add("roomId", param.m_roomId);
                data.Add("value", param.m_setLimit);
                data.Add("result", (int)res);
                data.Add("resStr", OpResMgr.getInstance().getResultString(res));

                ret = BaseJsonSerializer.genJsonStr(data);
            }
            break;

            case 1:
            {
                List <Dictionary <string, object> > dataList =
                    (List <Dictionary <string, object> >)user.getSys <DyOpMgr>(SysType.sysTypeDyOp).getResult(DyOpType.opTypeModifyAPISetLimit);

                Dictionary <string, object> data = new Dictionary <string, object>();
                data.Add("limitList", dataList);
                data.Add("base", DefCC.MONEY_BASE);
                ret = BaseJsonSerializer.genJsonStr(data);
            }
            break;
            }
            context.Response.ContentType = "text/plain";
            context.Response.Write(ret);
        }
Пример #16
0
    public override string getDescription(OpInfo info, string str)
    {
        if (info == null)
        {
            return("引用空");
        }

        LogBlockAcc param = BaseJsonSerializer.deserialize <LogBlockAcc>(str);

        if (param != null)
        {
            if (param.m_isBlock)
            {
                return(string.Format(info.m_fmt, "封", param.m_acc));
            }
            return(string.Format(info.m_fmt, "解封", param.m_acc));
        }
        return("");
    }
Пример #17
0
    public override string getDescription(OpInfo info, string str)
    {
        if (info == null)
        {
            return("引用空");
        }

        LogSendMail param = BaseJsonSerializer.deserialize <LogSendMail>(str);

        if (param != null)
        {
            if (param.m_playerList == "")
            {
                return(string.Format(info.m_fmt, "全服", param.m_title, param.m_sender, param.m_content, param.m_itemList, param.m_validDay));
            }
            return(string.Format(info.m_fmt, param.m_playerList, param.m_title, param.m_sender, param.m_content, param.m_itemList, param.m_validDay));
        }
        return("");
    }
Пример #18
0
    public override string getDescription(OpInfo info, string str)
    {
        if (info == null)
        {
            return("引用空");
        }

        LogWishCurse param = BaseJsonSerializer.deserialize <LogWishCurse>(str);

        if (param != null)
        {
            return(string.Format(info.m_fmt,
                                 StrName.s_gameName[param.m_gameId],
                                 param.m_playerId,
                                 param.m_opType == 0 ? "添加" : "去除",
                                 StrName.s_wishCurse[param.m_wishType]));
        }
        return("");
    }
Пример #19
0
    public override string getDescription(OpInfo info, string str)
    {
        if (info == null)
        {
            return("引用空");
        }

        LogGmRecharge param = BaseJsonSerializer.deserialize <LogGmRecharge>(str);

        if (param != null)
        {
            RechargeCFGData rd = RechargeCFG.getInstance().getValue(param.m_param);
            if (rd != null)
            {
                return(string.Format(info.m_fmt, param.m_playerId, StrName.s_rechargeType[param.m_rtype], rd.m_price));
            }
        }
        return("");
    }
Пример #20
0
    public override string getDescription(OpInfo info, string str)
    {
        if (info == null)
        {
            return("引用空");
        }

        LogPlayerOp param = BaseJsonSerializer.deserialize <LogPlayerOp>(str);

        if (param != null)
        {
            return(string.Format(info.m_fmt,
                                 param.m_playerId,
                                 param.m_op == 1 ? "增加" : "减少",
                                 param.m_value,
                                 getProp(param)));
        }
        return("");
    }
Пример #21
0
    public override string getDescription(OpInfo info, string str)
    {
        if (info == null)
        {
            return("引用空");
        }

        LogCowsAddCardType param = BaseJsonSerializer.deserialize <LogCowsAddCardType>(str);

        if (param != null)
        {
            return(string.Format(info.m_fmt,
                                 ItemHelp.getCowsCardTypeName(param.m_bankerType),
                                 ItemHelp.getCowsCardTypeName(param.m_other1Type),
                                 ItemHelp.getCowsCardTypeName(param.m_other2Type),
                                 ItemHelp.getCowsCardTypeName(param.m_other3Type),
                                 ItemHelp.getCowsCardTypeName(param.m_other4Type)));
        }
        return("");
    }
Пример #22
0
        public void ProcessRequest(HttpContext context)
        {
            RightMgr.getInstance().opCheck(RightDef.OP_WISH_CURSE, context.Session, context.Response);
            ParamAddWishCurse param = new ParamAddWishCurse();

            param.m_opType   = Convert.ToInt32(context.Request.Form["op"]);
            param.m_playerId = context.Request.Form["playerId"];
            param.m_rate     = context.Request.Form["value"];

            GMUser user = (GMUser)context.Session["user"];
            OpRes  res  = user.doDyop(param, DyOpType.opTypeWishCurse);
            string str  = "";

            Dictionary <string, object> data = new Dictionary <string, object>();

            data.Add("op", param.m_opType);

            switch (param.m_opType)
            {
            case 2:
            {
                List <ViewAddWishCurseItem> itemList =
                    (List <ViewAddWishCurseItem>)user.getSys <DyOpMgr>(SysType.sysTypeDyOp).getResult(DyOpType.opTypeWishCurse);
                data.Add("buffList", BaseJsonSerializer.serialize(itemList));
                str = ItemHelp.genJsonStr(data);
            }
            break;

            case 1:
            {
                data.Add("result", (int)res);
                data.Add("playerId", param.m_playerId);
                str = ItemHelp.genJsonStr(data);
            }
            break;
            }
            context.Response.ContentType = "text/plain";
            context.Response.Write(str);
        }
Пример #23
0
    // 解析百家乐json串信息
    public static InfoBaccarat parseInfoBaccarat(string exInfo)
    {
        InfoBaccarat info = null;

        try
        {
            Dictionary <string, object> dic = BaseJsonSerializer.deserialize <Dictionary <string, object> >(exInfo);
            info = new InfoBaccarat();
            if (dic.ContainsKey("betinfo"))
            {
                info.m_betInfo = BaseJsonSerializer.deserialize <List <BetInfo> >(dic["betinfo"].ToString());
            }
            if (dic.ContainsKey("bankercard"))
            {
                info.m_bankerCard = BaseJsonSerializer.deserialize <List <CardInfo> >(dic["bankercard"].ToString());
            }
            if (dic.ContainsKey("playercard"))
            {
                info.m_playerCard = BaseJsonSerializer.deserialize <List <CardInfo> >(dic["playercard"].ToString());
            }
            if (dic.ContainsKey("isbanker"))
            {
                int t = Convert.ToInt32(dic["isbanker"]);
                info.setIsBanker(t);
            }
            if (dic.ContainsKey("chargerate"))
            {
                info.m_serviceChargeRatio = Convert.ToInt32(dic["chargerate"]);
            }
            if (dic.ContainsKey("charge"))
            {
                info.m_serviceCharge = Convert.ToInt32(dic["charge"]);
            }
        }
        catch (System.Exception ex)
        {
        }
        return(info);
    }
Пример #24
0
    // 解析鳄鱼公园json串信息
    public static InfoFishPark parseInfoFishPark(string exInfo)
    {
        InfoFishPark info = null;

        try
        {
            Dictionary <string, object> dic = BaseJsonSerializer.deserialize <Dictionary <string, object> >(exInfo);
            info = new InfoFishPark();
            if (dic.ContainsKey("Abandonedbullets"))
            {
                info.m_abandonedbullets = Convert.ToInt32(dic["Abandonedbullets"]);
            }
            if (dic.ContainsKey("fishinfos"))
            {
                info.m_fish = BaseJsonSerializer.deserialize <List <DbFish> >(dic["fishinfos"].ToString());
            }
            info.sort();
        }
        catch (System.Exception ex)
        {
        }
        return(info);
    }
Пример #25
0
    // 解析骰宝json串信息
    public static InfoDice parseInfoDice(string exInfo)
    {
        InfoDice info = null;

        try
        {
            Dictionary <string, object> dic = BaseJsonSerializer.deserialize <Dictionary <string, object> >(exInfo);
            info = new InfoDice();
            if (dic.ContainsKey("dics_info"))
            {
                int num = Convert.ToInt32(dic["dics_info"]);
                info.setDiceNum(num);
            }
            if (dic.ContainsKey("bet_info"))
            {
                info.m_betInfo = BaseJsonSerializer.deserialize <List <DbDiceBet> >(dic["bet_info"].ToString());
            }
        }
        catch (System.Exception ex)
        {
        }
        return(info);
    }
        public void ProcessRequest(HttpContext context)
        {
            RightMgr.getInstance().opCheck(RIGHT.APPROVE_API, context.Session, context.Response);

            string op  = context.Request.Form["op"];
            string acc = context.Request.Form["acc"];

            Dictionary <string, object> ret = new Dictionary <string, object>();

            GMUser          user  = (GMUser)context.Session["user"];
            ParamApiApprove param = new ParamApiApprove();

            param.m_apiAcc = acc;
            param.m_isPass = (op == "pass");
            OpRes res = user.doDyop(param, DyOpType.opTypeDyOpApiApprove);

            ret.Add("result", (int)res);
            ret.Add("op", op);
            ret.Add("acc", acc);

            if (res == OpRes.opres_success && param.m_isPass)
            {
                string str = "审批成功," +
                             OpResMgr.getInstance().getResultString(OpRes.op_res_account_info, param.m_resultAcc, param.m_validatedCode);

                ret.Add("resultMsg", str);
            }
            else
            {
                ret.Add("resultMsg", OpResMgr.getInstance().getResultString(res));
            }

            string retStr = BaseJsonSerializer.genJsonStr(ret);

            context.Response.ContentType = "text/plain";
            context.Response.Write(retStr);
        }
Пример #27
0
 // 返回要存入数据库的参数串
 public override string getString()
 {
     return(BaseJsonSerializer.serialize(this));
 }
 public PricingServiceApiTests()
     : base(new ApiContext(Environments.Sandbox))
 {
     serializer = new DefaultJsonSerializer();
 }
Пример #29
0
        public void ProcessRequest(HttpContext context)
        {
            RightMgr.getInstance().opCheck("", context.Session, context.Response);

            GMUser       user = (GMUser)context.Session["user"];
            DyOpPlayerOp dyop =
                (DyOpPlayerOp)user.getSys <DyOpMgr>(SysType.sysTypeDyOp).getDyOp(DyOpType.opTypePlayerOp);

            Dictionary <string, object> ret = new Dictionary <string, object>();

            string op  = context.Request.Form["op"];
            string acc = context.Request.Form["acc"];

            switch (op)
            {
            case "modifyName":     // 修改别名
            {
                string newName = context.Request.Form["param"];
                OpRes  res     = dyop.modifyPlayerAliasName(acc, newName, user);
                ret.Add("resultMsg", OpResMgr.getInstance().getResultString(res));
            }
            break;

            case "resetPwd":     // 重置密码
            {
                string newPwd = context.Request.Form["param"];
                OpRes  res    = dyop.resetPlayerPwd(acc, newPwd, user);
                ret.Add("resultMsg", OpResMgr.getInstance().getResultString(res));
            }
            break;

            case "blockAcc":     // 停封解封账号
            {
                bool  isBlock = Convert.ToBoolean(context.Request.Form["param"]);
                OpRes res     = dyop.blockPlayerAcc(acc, isBlock, user);
                ret.Add("resultMsg", OpResMgr.getInstance().getResultString(res));
            }
            break;

            case "kick":     // 踢玩家
            {
                OpRes  res    = dyop.kickPlayerAcc(acc, user);
                string tmpStr = OpResMgr.getInstance().getResultString(res);
                if (res == OpRes.opres_success)
                {
                    tmpStr += ",该玩家10分钟以内不能重新登录";
                }
                ret.Add("resultMsg", tmpStr);
            }
            break;

            case "unlock":     // 解锁玩家
            {
                OpRes  res    = dyop.unlockPlayer(acc, user);
                string tmpStr = OpResMgr.getInstance().getResultString(res);
                ret.Add("resultMsg", tmpStr);
            }
            break;

            case "clearFail":     // 清理登录失败次数
            {
                OpRes  res    = dyop.clearPlayerFailCount(acc, user);
                string tmpStr = OpResMgr.getInstance().getResultString(res);
                ret.Add("resultMsg", tmpStr);
            }
            break;

            case "affectRate":     // 影响盈利率
            {
                bool   isAffect = Convert.ToBoolean(context.Request.Form["param"]);
                OpRes  res      = dyop.playerAffectEarnRate(acc, isAffect, user);
                string tmpStr   = "";
                if (res == OpRes.op_res_player_in_game)
                {
                    tmpStr = "需要先下线,再点击才会生效";
                }
                else
                {
                    tmpStr = OpResMgr.getInstance().getResultString(res);
                }
                ret.Add("resultMsg", tmpStr);
            }
            break;
            }

            string str = BaseJsonSerializer.genJsonStr(ret);

            context.Response.ContentType = "text/plain";
            context.Response.Write(str);
        }
Пример #30
0
    public override OpRes doGrantBenefit(object param, GMUser user)
    {
        ParamGrant       p         = (ParamGrant)param;
        List <ParamItem> item_list = new List <ParamItem>();

        try
        {
            Match match = Regex.Match(p.m_grantParam, Exp.TWO_NUM_BY_SPACE);
            if (!match.Success)
            {
                match = Regex.Match(p.m_grantParam, Exp.TWO_NUM_BY_SPACE_SEQ);
                if (!match.Success)
                {
                    return(OpRes.op_res_param_not_valid);
                }
            }
            parseItem(p.m_grantParam, item_list);
        }
        catch (System.Exception ex)
        {
            return(OpRes.op_res_failed);
        }

        if (item_list.Count == 0)
        {
            return(OpRes.op_res_param_not_valid);
        }

        for (int i = 0; i < item_list.Count; i++)
        {
        }

        if (p.m_target == GrantTarget.grant_target_someone)
        {
            OpRes res = addItemToSomeOne(p, item_list, user);
            if (res == OpRes.opres_success)
            {
            }
            return(res);
        }

        int level = 1;

        if (p.m_level != "")
        {
            try
            {
                // 转至level
                level = Convert.ToInt32(p.m_level);
                if (level <= 0)
                {
                    level = 1;
                }
            }
            catch (System.Exception ex)
            {
                return(OpRes.op_res_failed);
            }
        }
        IMongoQuery imq = getLevelImq(p.m_target == GrantTarget.grant_target_vip, level);

        /*string guid = firstPlayerGUID(p.m_target == GrantTarget.grant_target_vip, user, imq, getPlatformName(p.m_platIndex));
         * while (guid != "")
         * {
         *  for (int i = 0; i < item_list.Count; i++)
         *  {
         *      DBAddBenefit tmp = new DBAddBenefit();
         *      tmp.m_playerGUID = guid;
         *      tmp.m_grantType = (int)GrantType.gran_type_item;
         *      tmp.m_count = item_list[i].m_itemCount;
         *      tmp.m_exParam1 = item_list[i].m_itemId;       // 这个参数存储道具ID
         *      addBenefitToDB(tmp, user);
         *  }
         *  guid = nextPlayerGUID(user);
         * }*/
#if _OLD_BENEFIT_
        List <string> guid_list = new List <string>();
        initBenefit(p.m_target == GrantTarget.grant_target_vip, user, imq, getPlatformName(p.m_platIndex));
        bool run = nextPlayerGUIDList(user, 1000, guid_list);
        while (run)
        {
            for (int j = 0; j < guid_list.Count; j++)
            {
                for (int i = 0; i < item_list.Count; i++)
                {
                    DBAddBenefit tmp = new DBAddBenefit();
                    tmp.m_playerGUID = guid_list[j];
                    tmp.m_grantType  = (int)GrantType.gran_type_item;
                    tmp.m_count      = item_list[i].m_itemCount;
                    tmp.m_exParam1   = item_list[i].m_itemId;     // 这个参数存储道具ID
                    addBenefitToDB(tmp, user);
                }
            }
            run = nextPlayerGUIDList(user, 1000, guid_list);
        }
#else
        DBAddBenefit tmp = new DBAddBenefit();
        tmp.m_grantType = (int)GrantType.gran_type_item;
        tmp.m_exParam2  = BaseJsonSerializer.serialize(item_list);
        addFullBenefitToDB(tmp, user, p.m_platIndex);
#endif
//         OpLogMgr.getInstance().addLog(LogType.LOG_TYPE_ADD_BENEFIT_ITEM,
//             new ParamAddBenefitItem(p.m_playerId, item_list, (int)p.m_target, level, getPlatformName(p.m_platIndex, false)), user);
        return(OpRes.opres_success);
    }