コード例 #1
0
    // 返回账号acc的余额
    public static long getRemainMoney(string acc, bool isPlayer, GMUser user)
    {
        string             sql = "";
        SqlSelectGenerator gen = new SqlSelectGenerator();

        gen.addField("money");
        if (isPlayer)
        {
            sql = gen.getResultSql(TableName.PLAYER_ACCOUNT_XIANXIA,
                                   string.Format("acc='{0}'", acc));
        }
        else
        {
            sql = gen.getResultSql(TableName.GM_ACCOUNT,
                                   string.Format("acc='{0}'", acc));
        }
        Dictionary <string, object> data = user.sqlDb.queryOne(sql, user.getMySqlServerID(), MySqlDbName.DB_XIANXIA);

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

        return(Convert.ToInt64(data["money"]));
    }
コード例 #2
0
    // 返回玩家账号余额
    public long getRemainMoney(string acc)
    {
        SqlSelectGenerator gen = new SqlSelectGenerator();

        gen.addField("money");
        string sql = gen.getResultSql(TableName.PLAYER_ACCOUNT_XIANXIA,
                                      string.Format("acc='{0}'", acc));

        Dictionary <string, object> data = m_sqlDb.queryOne(sql, CMySqlDbName.DB_XIANXIA);

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

        return(Convert.ToInt64(data["money"]));
    }