public bool addNotice(string title, string content, int dayamount, GMUser user)
    {
        if (user == null)
        {
            return(false);
        }

        string[] sp  = { "\r\n" };
        string[] tmp = content.Split(sp, StringSplitOptions.None);
        int      i   = 0;

        content = "";
        for (; i < tmp.Length - 1; i++)
        {
            content += tmp[i];
            content += "&";
        }
        content += tmp[i];
        bool res = _addNotice(title, content, dayamount, user.getDbServerID());

        if (res)
        {
            //  OpLogMgr.getInstance().addLog(LogType.PUBLIC_NOTICE, new ParamAddNotice(title, content, dayamount), user);
        }
        user.setOpResult(res ? OpRes.opres_success : OpRes.op_res_failed);
        return(res);
    }
    private OpRes query(ParamGameHistory param, IMongoQuery imq, GMUser user)
    {
        fillData fillFun   = null;
        string   tableName = getTableName(param, ref fillFun);

        if (tableName == "")
        {
            return(OpRes.op_res_not_found_data);
        }

        user.totalRecord = DBMgr.getInstance().getRecordCount(tableName, imq,
                                                              user.getDbServerID(), DbName.DB_PUMP);

        List <Dictionary <string, object> > dataList = DBMgr.getInstance().executeQuery(tableName,
                                                                                        user.getDbServerID(),
                                                                                        DbName.DB_PUMP,
                                                                                        imq,
                                                                                        (param.m_curPage - 1) * param.m_countEachPage,
                                                                                        param.m_countEachPage);

        if (dataList == null || dataList.Count == 0)
        {
            return(OpRes.op_res_not_found_data);
        }

        fillFun(param, user, dataList);

        return(OpRes.opres_success);
    }
Exemplo n.º 3
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);
    }
    // 金币下注分布
    private OpRes queryOutlayDistribution(ParamQuery param, IMongoQuery imq, GMUser user)
    {
        List <Dictionary <string, object> > dataList =
            DBMgr.getInstance().executeQuery(TableName.STAT_NEW_PLAYER_OUTLAY_DISTRIBUTION,
                                             user.getDbServerID(), DbName.DB_PUMP, imq,
                                             0, 0, null, "genTime", false);

        if (dataList == null || dataList.Count == 0)
        {
            return(OpRes.op_res_not_found_data);
        }

        int i = 0;

        for (i = 0; i < dataList.Count; i++)
        {
            Dictionary <string, object> data = dataList[i];
            DateTime time = Convert.ToDateTime(data["genTime"]).ToLocalTime();

            for (int k = 0; k < 11; k++)
            {
                int val = Convert.ToInt32(data[k.ToString()]);
                m_result.addOutlayInfo(time, k, val);
            }
        }

        return(OpRes.opres_success);
    }
Exemplo n.º 5
0
    // 开始统计
    public override OpRes doStat(object param, GMUser user)
    {
        m_result.reset();
        MapReduceResult map_result = DBMgr.getInstance().executeMapReduce(TableName.PLAYER_INFO,
                                                                          user.getDbServerID(),
                                                                          DbName.DB_PLAYER,
                                                                          null,
                                                                          MapReduceTable.getMap("vipLevel"),
                                                                          MapReduceTable.getReduce("vipLevel"));

        if (map_result != null)
        {
            IEnumerable <BsonDocument> bson = map_result.GetResults();
            foreach (BsonDocument d in bson)
            {
                try
                {
                    BsonValue resValue = d["value"];
                    int       count    = resValue["count"].ToInt32();
                    int       vip      = Convert.ToInt32(d["_id"]);
                    m_result.addVipLevel(vip, count);
                }
                catch (System.Exception ex)
                {
                }
            }
        }
        return(OpRes.opres_success);
    }
Exemplo n.º 6
0
    void getSEValue(ParamQuery param, GMUser user, string[] fields, int playerId, ref long svalue, ref long evalue)
    {
        DateTime mint = DateTime.Now, maxt = DateTime.Now;

        Tool.splitTimeStr(param.m_time, ref mint, ref maxt);

        IMongoQuery imq1 = Query.LT("genTime", BsonValue.Create(maxt));
        IMongoQuery imq2 = Query.GTE("genTime", BsonValue.Create(mint));
        IMongoQuery imq  = Query.And(imq1, imq2, Query.EQ("playerId", BsonValue.Create(playerId)));

        List <Dictionary <string, object> > dataList = DBMgr.getInstance().executeQuery(TableName.STAT_PLAYER_DRAGON,
                                                                                        user.getDbServerID(),
                                                                                        DbName.DB_PUMP,
                                                                                        imq, 0, 1, fields, "genTime", true);

        if (dataList.Count > 0)
        {
            svalue = Convert.ToInt32(dataList[0][fields[0]]);
        }

        dataList = DBMgr.getInstance().executeQuery(TableName.STAT_PLAYER_DRAGON,
                                                    user.getDbServerID(),
                                                    DbName.DB_PUMP,
                                                    imq, 0, 1, fields, "genTime", false);
        if (dataList.Count > 0)
        {
            evalue = Convert.ToInt32(dataList[0][fields[1]]);
        }
    }
    private OpRes queryEnterRoom(ParamQuery param, IMongoQuery imq, GMUser user)
    {
        List <Dictionary <string, object> > dataList =
            DBMgr.getInstance().executeQuery(TableName.STAT_NEW_PLAYER_ENTER_ROOM,
                                             user.getDbServerID(), DbName.DB_PUMP, imq,
                                             0, 0, null, "genTime", false);

        if (dataList == null || dataList.Count == 0)
        {
            return(OpRes.op_res_not_found_data);
        }

        int i = 0;

        for (i = 0; i < dataList.Count; i++)
        {
            Dictionary <string, object> data = dataList[i];
            DateTime time       = Convert.ToDateTime(data["genTime"]).ToLocalTime();
            int      roomId     = Convert.ToInt32(data["roomId"]);
            int      enterCount = Convert.ToInt32(data["enterCount"]);
            m_result.addEnterCount(time, roomId, enterCount);
        }

        return(OpRes.opres_success);
    }
Exemplo n.º 8
0
    // 给指定玩家加钱,gold金币, gem钻石
    public bool addPlayerMoney(int playerid, int gold, int gem, GMUser account)
    {
        if (gold < 0 || gem < 0 || account == null)
        {
            LOG.Info("给玩家id [{0}]增加金币时出错,传入的值为负!", playerid);
            return(false);
        }

        bool res = _addPlayerMoney(playerid, gold, gem, account.getDbServerID());

        if (res)
        {
            Dictionary <string, object> data =
                null; // DBMgr.getInstance().getTableData("EtPlayer", "Id", playerid, account.getDbServerID(), DbName.DB_FISH_LORD);
            if (data != null)
            {
                if (data.ContainsKey("IsBot"))
                {
                    bool isbot = Convert.ToBoolean(data["IsBot"]);
                    if (!isbot)
                    {
                        OpLogMgr.getInstance().addLog(LogType.ADD_MONEY, new ParamAddMoney(playerid, gold, gem), account);
                    }
                }
            }
        }
        account.setOpResult(res ? OpRes.opres_success : OpRes.op_res_failed);
        return(res);
    }
Exemplo n.º 9
0
    protected override MapReduceResult getMapReduceResult(IMongoQuery imq, GMUser user)
    {
        MapReduceResult mapResult = DBMgr.getInstance().executeMapReduce(TableName.PUMP_ACTIVE_PERSON,
                                                                         user.getDbServerID(),
                                                                         DbName.DB_PUMP,
                                                                         imq,
                                                                         MapReduceTable.getMap("activePerson"),
                                                                         MapReduceTable.getReduce("activePerson"));

        return(mapResult);
    }
Exemplo n.º 10
0
    protected OpRes query(ParamSearch param, IMongoQuery imq, GMUser user, string tableName, int dbName)
    {
        user.totalRecord = DBMgr.getInstance().getRecordCount(tableName,
                                                              imq, user.getDbServerID(), dbName);

        List <Dictionary <string, object> > data =
            DBMgr.getInstance().executeQuery(tableName,
                                             user.getDbServerID(),
                                             DbName.DB_ACCOUNT, imq,
                                             (param.m_curPage - 1) * param.m_countEachPage,
                                             param.m_countEachPage,
                                             param.m_retFields,
                                             "date",
                                             false);

        if (data == null || data.Count == 0)
        {
            return(OpRes.op_res_not_found_data);
        }

        int i = 0;

        for (i = 0; i < data.Count; i++)
        {
            ResultItem tmp = new ResultItem();
            m_result.Add(tmp);

            tmp.m_time = Convert.ToDateTime(data[i]["date"]).ToLocalTime().ToShortDateString();

            foreach (var d in data[i])
            {
                if (d.Key == "date")
                {
                    continue;
                }

                tmp.addValue(d.Key, Convert.ToInt64(d.Value));
            }
        }
        return(OpRes.opres_success);
    }
Exemplo n.º 11
0
    // 开始统计
    public override OpRes doStat(object param, GMUser user)
    {
        m_result.Clear();
        m_cond.startQuery();
        OpRes res = makeQuery(param, user, m_cond);

        if (res != OpRes.opres_success)
        {
            return(res);
        }

        ParamQuery p = (ParamQuery)param;

        if (isSame(p, user))
        {
            return(query(p, null, user));
        }
        else
        {
            m_lastSearchTime = p.m_time;
            m_dbId           = user.getDbServerID();
        }

        IMongoQuery imqTime = m_cond.getImq();

        MapReduceResult map_result = DBMgr.getInstance().executeMapReduce(TableName.STAT_PLAYER_DRAGON,
                                                                          user.getDbServerID(),
                                                                          DbName.DB_PUMP,
                                                                          imqTime,
                                                                          MapReduceTable.getMap("playerDragonBall"),
                                                                          MapReduceTable.getReduce("playerDragonBall"),
                                                                          MapTable);

        if (map_result != null)
        {
            return(query(p, null, user));
        }
        return(OpRes.opres_success);
    }
Exemplo n.º 12
0
    // 开始统计
    public override OpRes doStat(object param, GMUser user)
    {
        m_result.Clear();
        m_cond.startQuery();
        OpRes res = makeQuery(param, user, m_cond);

        if (res != OpRes.opres_success)
        {
            return(res);
        }

        ParamIncomeExpenses p = (ParamIncomeExpenses)param;

        if (isSame(p, user))
        {
            return(query(p, null, user));
        }
        else
        {
            m_lastParam.assign(p, user.getDbServerID());
        }

        IMongoQuery imqTime = m_cond.getImq();

        MapReduceResult map_result = DBMgr.getInstance().executeMapReduce(TableName.STAT_INCOME_EXPENSES,
                                                                          user.getDbServerID(),
                                                                          DbName.DB_PUMP,
                                                                          imqTime,
                                                                          MapReduceTable.getMap("playerIncomeExpenses"),
                                                                          MapReduceTable.getReduce("playerIncomeExpenses"),
                                                                          MapTable);

        if (map_result != null)
        {
            return(query(p, null, user));
        }
        return(OpRes.opres_success);
    }
Exemplo n.º 13
0
    protected virtual OpRes query(ParamQuery param, IMongoQuery imq, GMUser user)
    {
        // 查看满足条件的记当个数
        user.totalRecord = DBMgr.getInstance().getRecordCount(MapTable, null, user.getDbServerID(), DbName.DB_PUMP);

        List <BsonDocument> data =
            DBMgr.getInstance().executeQueryBsonDoc(MapTable, user.getDbServerID(), DbName.DB_PUMP, null,
                                                    (param.m_curPage - 1) * param.m_countEachPage, param.m_countEachPage,
                                                    null, "value.rechargeMoney", false);

        if (data == null || data.Count == 0)
        {
            return(OpRes.op_res_not_found_data);
        }

        int i = 0;

        for (i = 0; i < data.Count; i++)
        {
            addResult(data[i], user);
        }
        return(OpRes.opres_success);
    }
    OpRes statAve(IMongoQuery imq, GMUser user)
    {
        m_result.Clear();
        MapReduceResult mapResult = DBMgr.getInstance().executeMapReduce(TableName.STAT_PLAYER_GAME_BET_RESULT,
                                                                         user.getDbServerID(),
                                                                         DbName.DB_PUMP,
                                                                         imq,
                                                                         MapReduceTable.getMap("userGameBet"),
                                                                         MapReduceTable.getReduce("userGameBet"));

        if (mapResult != null)
        {
            IEnumerable <BsonDocument> bson = mapResult.GetResults();

            foreach (BsonDocument d in bson)
            {
                ResultItemPlayerGameBet tmp = new ResultItemPlayerGameBet();
                m_result.Add(tmp);

                BsonValue resValue = d["value"];

                tmp.m_time  = Convert.ToDateTime(d["_id"]).ToLocalTime();
                tmp.m_round = resValue["playerCount"].ToInt32();

                long   max = resValue["maxCarry"].ToInt64();
                long   min = resValue["minCarry"].ToInt64();
                double sum = resValue["sumCarry"].ToDouble();
                tmp.addData(ResultItemPlayerGameBet.CARRY, sum, max, min);

                max = resValue["maxOutlay"].ToInt64();
                min = resValue["minOutlay"].ToInt64();
                sum = resValue["sumOutlay"].ToDouble();
                tmp.addData(ResultItemPlayerGameBet.OUTLAY, sum, max, min);

                max = resValue["maxWin"].ToInt64();
                min = resValue["minWin"].ToInt64();
                sum = resValue["sumWin"].ToDouble();
                tmp.addData(ResultItemPlayerGameBet.WIN, sum, max, min);

                max = resValue["maxLose"].ToInt64();
                min = resValue["minLose"].ToInt64();
                sum = resValue["sumLose"].ToDouble();
                tmp.addData(ResultItemPlayerGameBet.LOSE, sum, max, min);

                tmp.m_rw = resValue["rw"].ToInt64();
            }
        }

        return(OpRes.opres_success);
    }
Exemplo n.º 15
0
    // 开始统计
    public override OpRes doStat(object param, GMUser user)
    {
        IMongoQuery imqTime = null;
        string      time    = (string)param;

        if (!string.IsNullOrEmpty(time))
        {
            DateTime mint = DateTime.Now, maxt = DateTime.Now;
            bool     res = Tool.splitTimeStr(time, ref mint, ref maxt);
            if (!res)
            {
                return(OpRes.op_res_time_format_error);
            }

            m_result.reset();

            IMongoQuery imq1 = Query.LT("create_time", BsonValue.Create(maxt));
            IMongoQuery imq2 = Query.GTE("create_time", BsonValue.Create(mint));
            imqTime = Query.And(imq1, imq2);
        }

        m_result.reset();
        MapReduceResult map_result = DBMgr.getInstance().executeMapReduce(TableName.PLAYER_INFO,
                                                                          user.getDbServerID(),
                                                                          DbName.DB_PLAYER,
                                                                          imqTime,
                                                                          MapReduceTable.getMap("vipLevel"),
                                                                          MapReduceTable.getReduce("vipLevel"));

        if (map_result != null)
        {
            IEnumerable <BsonDocument> bson = map_result.GetResults();
            foreach (BsonDocument d in bson)
            {
                try
                {
                    BsonValue resValue = d["value"];
                    int       count    = resValue["count"].ToInt32();
                    int       vip      = Convert.ToInt32(d["_id"]);
                    m_result.addVipLevel(vip, count);
                }
                catch (System.Exception ex)
                {
                }
            }
        }
        return(OpRes.opres_success);
    }
    private OpRes query(ParamQuery param, IMongoQuery imq, GMUser user)
    {
        List <Dictionary <string, object> > dataList =
            DBMgr.getInstance().executeQuery(TableName.STAT_PLAYER_GAME_BET_RESULT, user.getDbServerID(), DbName.DB_PUMP, imq,
                                             0, 0, null, "genTime", false);

        if (dataList == null || dataList.Count == 0)
        {
            return(OpRes.op_res_not_found_data);
        }

        int i = 0;

        for (i = 0; i < dataList.Count; i++)
        {
            ResultItemPlayerGameBet tmp = new ResultItemPlayerGameBet();
            m_result.Add(tmp);

            Dictionary <string, object> data = dataList[i];
            tmp.m_time     = Convert.ToDateTime(data["genTime"]).ToLocalTime();
            tmp.m_round    = Convert.ToInt32(data["round"]);
            tmp.m_playerId = Convert.ToInt32(data["playerId"]);
            tmp.m_gameId   = Convert.ToInt32(data["gameId"]);

            long max = Convert.ToInt64(data["maxCarry"]);
            long min = Convert.ToInt64(data["minCarry"]);
            long sum = Convert.ToInt64(data["sumCarry"]);
            tmp.addData(ResultItemPlayerGameBet.CARRY, sum, max, min);

            max = Convert.ToInt64(data["maxOutlay"]);
            min = Convert.ToInt64(data["minOutlay"]);
            sum = Convert.ToInt64(data["sumOutlay"]);
            tmp.addData(ResultItemPlayerGameBet.OUTLAY, sum, max, min);

            max = Convert.ToInt64(data["maxWin"]);
            min = Convert.ToInt64(data["minWin"]);
            sum = Convert.ToInt64(data["sumWin"]);
            tmp.addData(ResultItemPlayerGameBet.WIN, sum, max, min);

            max = Convert.ToInt64(data["maxLose"]);
            min = Convert.ToInt64(data["minLose"]);
            sum = Convert.ToInt64(data["sumLose"]);
            tmp.addData(ResultItemPlayerGameBet.LOSE, sum, max, min);
        }

        return(OpRes.opres_success);
    }
    public bool deleteNotice(int[] arr_index, GMUser account)
    {
        if (account == null)
        {
            return(false);
        }

        List <CSystemAnnounce> out_list = null;
        bool res = _deleteNotice(arr_index, ref out_list, account.getDbServerID());

        if (res)
        {
            if (out_list != null)
            {
                //  OpLogMgr.getInstance().addLog(LogType.DELETE_NOTICE, new ParamDeleteNotice(out_list), account);
            }
        }
        return(res);
    }
Exemplo n.º 18
0
    bool isSame(ParamIncomeExpenses p, GMUser user)
    {
        if (p.m_time != m_lastParam.m_time)
        {
            return(false);
        }

        if (user.getDbServerID() != m_lastParam.m_dbId)
        {
            return(false);
        }

        if (p.m_playerGainDb != m_lastParam.m_playerGainDb)
        {
            return(false);
        }

        return(true);
    }
    public bool activateNotice(int index, GMUser account)
    {
        if (account == null)
        {
            return(false);
        }

        CSystemAnnounce pa  = null;
        bool            res = _activateNotice(index, ref pa, account.getDbServerID());

        if (res)
        {
            if (pa != null)
            {
                // OpLogMgr.getInstance().addLog(LogType.ACTIVATE_NOTICE, new ParamActivateNotice(pa.mTitle, pa.mContent, pa.mDayAmount), account);
            }
        }
        return(res);
    }
Exemplo n.º 20
0
    // 删除统计数据
    public OpRes delAllStatData(int index, GMUser user)
    {
        if (user == null)
        {
            return(OpRes.op_res_failed);
        }
        if (index < 0 || index >= m_dels.Count)
        {
            return(OpRes.op_res_failed);
        }

        FishDelInfo info = m_dels[index];
        // 清除指定表中的所有数据
        bool res = DBMgr.getInstance().clearTable(info.m_tableName, user.getDbServerID(), DbName.DB_PUMP);

        if (res) // 添加LOG
        {
            //OpLogMgr.getInstance().addLog(LogType.LOG_TYPE_DEL_STAT_DATA, new ParamDelStatData(info.m_data), user);
            return(OpRes.opres_success);
        }
        return(OpRes.op_res_failed);
    }
Exemplo n.º 21
0
    // 向机器人批量加钱
    public bool addMoneyToBot(int gold, int gem, GMUser account)
    {
        if (gold < 0 || gem < 0 || account == null)
        {
            LOG.Info("给机器人加钱时出错,传入的值为负!");
            return(false);
        }

        int serverid = account.getDbServerID();
        List <Dictionary <string, object> > datalist =
            null; // DBMgr.getInstance().getDataListFromTable("EtPlayer", serverid, DbName.DB_FISH_LORD, "IsBot", true);

        if (datalist != null)
        {
            foreach (Dictionary <string, object> data in datalist)
            {
                int playerid = Convert.ToInt32(data["Id"]);
                _addPlayerMoney(playerid, gold, gem, serverid);
            }
        }
        account.setOpResult(OpRes.opres_success);
        OpLogMgr.getInstance().addLog(LogType.BATCH_ADD_MONEY, new ParamAddMoney(gold, gem), account);
        return(true);
    }
    public override OpRes doQuery(object param, GMUser user)
    {
        m_result.Clear();
        List <Dictionary <string, object> > dataList = DBMgr.getInstance().executeQuery(TableName.SHCD_RESULT,
                                                                                        user.getDbServerID(), DbName.DB_GAME, null, 0, 0, null, "insert_time", false);

        if (dataList == null)
        {
            return(OpRes.opres_success);
        }

        for (int i = 0; i < dataList.Count; i++)
        {
            GameResultShcd info = new GameResultShcd();
            info.m_insertTime = Convert.ToDateTime(dataList[i]["insert_time"]).ToLocalTime().ToString();
            info.m_result     = Convert.ToInt32(dataList[i]["next_card_type"]);
            m_result.Add(info);
        }

        return(OpRes.opres_success);
    }
    private OpRes query(GMUser user)
    {
        List <Dictionary <string, object> > dataList = DBMgr.getInstance().executeQuery(TableName.DRAGON_ROOM,
                                                                                        user.getDbServerID(), DbName.DB_GAME);

        if (dataList == null)
        {
            return(OpRes.opres_success);
        }

        for (int i = 0; i < dataList.Count; i++)
        {
            ResultDragonParam info = new ResultDragonParam();
            m_result.Add(info);

            info.m_roomId = Convert.ToInt32(dataList[i]["room_id"]);
            if (dataList[i].ContainsKey("expect_earn_rate"))
            {
                info.m_expRate = Convert.ToDouble(dataList[i]["expect_earn_rate"]);
            }
            else
            {
                info.m_expRate = 0.05;
            }

            if (dataList[i].ContainsKey("room_income")) // 总收入
            {
                info.m_totalIncome = Convert.ToInt64(dataList[i]["room_income"]);
            }
            if (dataList[i].ContainsKey("room_outcome"))  // 总支出
            {
                info.m_totalOutlay = Convert.ToInt64(dataList[i]["room_outcome"]);
            }
            if (dataList[i].ContainsKey("double_income"))  // 翻倍收入
            {
                info.m_doubleIncome = Convert.ToInt64(dataList[i]["double_income"]);
            }
            if (dataList[i].ContainsKey("double_outcome"))  // 翻倍支出
            {
                info.m_doubleOutcome = Convert.ToInt64(dataList[i]["double_outcome"]);
            }
        }

        return(OpRes.opres_success);
    }
    private OpRes queryLevel(GMUser user)
    {
        List <Dictionary <string, object> > dataList = DBMgr.getInstance().executeQuery(TableName.CALF_ROPING_PASS_LOG,
                                                                                        user.getDbServerID(), DbName.DB_PUMP);

        if (dataList == null)
        {
            return(OpRes.opres_success);
        }

        for (int i = 0; i < dataList.Count; i++)
        {
            ResultCalfRopingLevelItem item = new ResultCalfRopingLevelItem();
            m_result3.Add(item);

            Dictionary <string, object> data = dataList[i];

            if (data.ContainsKey("passid"))
            {
                item.m_passId = Convert.ToInt32(data["passid"]);
            }
            if (data.ContainsKey("hitcount"))
            {
                item.m_hitCount = Convert.ToInt64(data["hitcount"]);
            }
            if (data.ContainsKey("allcount"))
            {
                item.allcount = Convert.ToInt64(data["allcount"]);
            }
        }

        return(OpRes.opres_success);
    }
    private OpRes query(GMUser user, IMongoQuery imq)
    {
        List <Dictionary <string, object> > dataList = DBMgr.getInstance().executeQuery(TableName.DRAGON_TABLE,
                                                                                        user.getDbServerID(), DbName.DB_GAME, imq);

        if (dataList == null)
        {
            return(OpRes.opres_success);
        }

        long income = 0, outlay = 0;

        for (int i = 0; i < dataList.Count; i++)
        {
            income = outlay = 0;
            Dictionary <string, object> data = dataList[i];
            if (data.ContainsKey("table_income"))
            {
                income = Convert.ToInt64(data["table_income"]);
            }
            if (data.ContainsKey("normal_outcome"))
            {
                outlay = Convert.ToInt64(data["normal_outcome"]);
            }
            m_result.addModeData(ResultDragonGameModeEarning.MODE_NORMAL, income, outlay);

            income = outlay = 0;
            if (data.ContainsKey("free_outcome"))
            {
                outlay = Convert.ToInt64(data["free_outcome"]);
            }
            m_result.addModeData(ResultDragonGameModeEarning.MODE_FREE_GAME, income, outlay);

            income = outlay = 0;
            if (data.ContainsKey("double_income"))
            {
                income = Convert.ToInt64(data["double_income"]);
            }
            if (data.ContainsKey("double_outcome"))
            {
                outlay = Convert.ToInt64(data["double_outcome"]);
            }
            m_result.addModeData(ResultDragonGameModeEarning.MODE_DOUBLE, income, outlay);
        }

        return(OpRes.opres_success);
    }
    private OpRes queryIndependent(GMUser user)
    {
        List <Dictionary <string, object> > dataList = DBMgr.getInstance().executeQuery(TableName.CALF_ROPING_ROOM,
                                                                                        user.getDbServerID(), DbName.DB_GAME);

        if (dataList == null)
        {
            return(OpRes.opres_success);
        }

        for (int i = 0; i < dataList.Count; i++)
        {
            Dictionary <string, object> data = dataList[i];

            if (data.ContainsKey("enter_count"))
            {
                m_result1.m_enterCount = Convert.ToInt64(data["enter_count"]);
            }
            if (data.ContainsKey("NorRewardNum"))
            {
                m_result1.m_norRewardNum = Convert.ToInt64(data["NorRewardNum"]);
            }
            if (data.ContainsKey("NorRewardGold"))
            {
                m_result1.m_norRewardGold = Convert.ToInt64(data["NorRewardGold"]);
            }
            if (data.ContainsKey("BigRewardNum"))
            {
                m_result1.m_bigRewardNum = Convert.ToInt64(data["BigRewardNum"]);
            }
            if (data.ContainsKey("BigRewardGold"))
            {
                m_result1.m_bigRewardGold = Convert.ToInt64(data["BigRewardGold"]);
            }
            if (data.ContainsKey("BuyLifeNum"))
            {
                m_result1.m_buyLifeNum = Convert.ToInt64(data["BuyLifeNum"]);
            }
        }

        return(OpRes.opres_success);
    }
    private OpRes queryParam(GMUser user)
    {
        List <Dictionary <string, object> > dataList = DBMgr.getInstance().executeQuery(TableName.CALF_ROPING_ROOM,
                                                                                        user.getDbServerID(), DbName.DB_GAME);

        if (dataList == null)
        {
            return(OpRes.opres_success);
        }

        for (int i = 0; i < dataList.Count; i++)
        {
            ResultExpRateParam info = new ResultExpRateParam();
            m_result.Add(info);

            if (dataList[i].ContainsKey("ExpectEarnRate"))
            {
                info.m_expRate = Convert.ToDouble(dataList[i]["ExpectEarnRate"]);
            }
            else
            {
                info.m_expRate = 0.05;
            }

            if (dataList[i].ContainsKey("lobby_income")) // 总收入
            {
                info.m_totalIncome = Convert.ToInt64(dataList[i]["lobby_income"]);
            }
            if (dataList[i].ContainsKey("lobby_outcome"))  // 总支出
            {
                info.m_totalOutlay = Convert.ToInt64(dataList[i]["lobby_outcome"]);
            }
        }

        return(OpRes.opres_success);
    }
    private OpRes query(GMUser user)
    {
        List <Dictionary <string, object> > dataList = DBMgr.getInstance().executeQuery(TableName.SHCDCARDS_ROOM,
                                                                                        user.getDbServerID(), DbName.DB_GAME);

        for (int i = 0; i < dataList.Count; i++)
        {
            for (int k = 1; k <= StrName.s_shcdArea.Length; k++)
            {
                // 总收入
                string totalWinKey = string.Format("WinGold{0}", k);
                // 总支出
                string totalLoseGoldKey = string.Format("LoseGold{0}", k);
                // 押注次数
                string betCountKey = string.Format("BetCount{0}", k);

                long income = 0, outlay = 0, betCount = 0;
                if (dataList[i].ContainsKey(totalWinKey))
                {
                    income = Convert.ToInt64(dataList[i][totalWinKey]);
                }
                if (dataList[i].ContainsKey(totalLoseGoldKey))
                {
                    outlay = Convert.ToInt64(dataList[i][totalLoseGoldKey]);
                }
                if (dataList[i].ContainsKey(betCountKey))
                {
                    betCount = Convert.ToInt64(dataList[i][betCountKey]);
                }
                m_result.addBetCount(k, betCount, 0, income, outlay);
            }
        }

        return(OpRes.opres_success);
    }
    private OpRes query(GMUser user)
    {
        List <Dictionary <string, object> > dataList = DBMgr.getInstance().executeQuery(TableName.COWS_ROOM,
                                                                                        user.getDbServerID(), DbName.DB_GAME);

        if (dataList == null)
        {
            return(OpRes.opres_success);
        }

        for (int i = 0; i < dataList.Count; i++)
        {
            ResultParamCows info = new ResultParamCows();
            info.m_roomId = Convert.ToInt32(dataList[i]["room_id"]);
            if (dataList[i].ContainsKey("ExpectEarnRate"))
            {
                info.m_expRate = Convert.ToDouble(dataList[i]["ExpectEarnRate"]);
            }
            else
            {
                info.m_expRate = 0.05;
            }

            if (dataList[i].ContainsKey("room_income")) // 总收入
            {
                info.m_totalIncome = Convert.ToInt64(dataList[i]["room_income"]);
            }
            if (dataList[i].ContainsKey("room_outcome"))  // 总支出
            {
                info.m_totalOutlay = Convert.ToInt64(dataList[i]["room_outcome"]);
            }
            if (dataList[i].ContainsKey("BankerAddGold")) // 上庄手续费
            {
                info.m_serviceCharge = Convert.ToInt64(dataList[i]["BankerAddGold"]);
            }
            if (dataList[i].ContainsKey("BankerSubGold")) // 爆庄支出
            {
                info.m_burstZhuang = Convert.ToInt64(dataList[i]["BankerSubGold"]);
            }
            if (dataList[i].ContainsKey("TotalRobotWinGold")) // 机器人收入
            {
                info.m_robotIncome = Convert.ToInt64(dataList[i]["TotalRobotWinGold"]);
            }
            if (dataList[i].ContainsKey("TotalRobotLoseGold")) // 机器人支出
            {
                info.m_robotOutlay = Convert.ToInt64(dataList[i]["TotalRobotLoseGold"]);
            }
            m_result.Add(info.m_roomId, info);
        }

        return(OpRes.opres_success);
    }
    private OpRes query(GMUser user)
    {
        List <Dictionary <string, object> > dataList = DBMgr.getInstance().executeQuery(TableName.SHCDCARDS_ROOM,
                                                                                        user.getDbServerID(), DbName.DB_GAME);

        if (dataList == null)
        {
            return(OpRes.opres_success);
        }

        for (int i = 0; i < dataList.Count; i++)
        {
            ResultShcdParam info = new ResultShcdParam();
            m_result.Add(info);

            info.m_roomId = Convert.ToInt32(dataList[i]["room_id"]);
            if (dataList[i].ContainsKey("ExpectEarnRate"))
            {
                info.m_expRate = Convert.ToDouble(dataList[i]["ExpectEarnRate"]);
            }
            else
            {
                info.m_expRate = 0.05;
            }

            if (dataList[i].ContainsKey("room_income")) // 总收入
            {
                info.m_totalIncome = Convert.ToInt64(dataList[i]["room_income"]);
            }
            if (dataList[i].ContainsKey("room_outcome"))  // 总支出
            {
                info.m_totalOutlay = Convert.ToInt64(dataList[i]["room_outcome"]);
            }

            if (dataList[i].ContainsKey("EarnRateControl"))
            {
                info.m_level = Convert.ToInt32(dataList[i]["EarnRateControl"]);
            }
            else
            {
                info.m_level = 0;
            }

            if (dataList[i].ContainsKey("next_joker_count"))
            {
                info.m_jokerCount = Convert.ToInt32(dataList[i]["next_joker_count"]);
            }
            else
            {
                info.m_jokerCount = 0;
            }

            if (dataList[i].ContainsKey("beginCheatIndex") && dataList[i].ContainsKey("endCheatIndex"))
            {
                info.m_cheatSE = Convert.ToString(dataList[i]["beginCheatIndex"]) + "-" +
                                 Convert.ToString(dataList[i]["endCheatIndex"]);
            }
            else
            {
                info.m_cheatSE = "";
            }
        }

        return(OpRes.opres_success);
    }