Exemplo n.º 1
0
def getALlCharacterBaseInfo():
    """获取所有的角色的基础信息
    """
    sql = "SELECT `id`,`level`,`profession`,`nickname` FROM tb_character;";
    result = dbpool.fetchAll(sql)

    return result
Exemplo n.º 2
0
def getProfession_Config():
    """获取职业配置表信息"""
    global tb_Profession_Config
    sql = "select * from tb_profession"
    result = dbpool.fetchAll(sql)
    for _item in result:
        tb_Profession_Config[_item['preId']] = _item
Exemplo n.º 3
0
def getALlCharacterBaseInfo():
    """获取所有的角色的基础信息
    """
    sql = "SELECT `id`,`level`,`profession`,`nickname` FROM tb_character;"
    result = dbpool.fetchAll(sql)

    return result
Exemplo n.º 4
0
def getCharacterBattleLog(characterId):
    """获取角色战斗日志
    """
    sql = "SELECT * from tb_arena_log where tiaozhan = %d \
    or yingzhan = %d order by recordtime desc limit 0,5;"%(characterId,characterId)
    result = dbpool.fetchAll(sql)
    return result
Exemplo n.º 5
0
def getFriendTopLevel(characterId,index,limit=20):
    """获取好友的等级排行
    """
    sql = "SELECT id,nickname,level,coin \
    FROM tb_character WHERE `id`!=%d ORDER BY level LIMIT %d,%d;"%(characterId,index,limit)
    result = dbpool.fetchAll(sql)
    return result
Exemplo n.º 6
0
def getPetExp():
    """获取宠物的经验表"""
    global PET_EXP
    sql = "SELECT * FROM tb_pet_experience"
    result = dbpool.fetchAll(sql)
    for exp in result:
        PET_EXP[exp["level"]] = exp["ExpRequired"]
Exemplo n.º 7
0
def getProfession_Config():
    """获取职业配置表信息"""
    global tb_Profession_Config
    sql = "select * from tb_profession"
    result = dbpool.fetchAll(sql)
    for _item in result:
        tb_Profession_Config[_item['preId']] = _item
Exemplo n.º 8
0
def getPetExp():
    """获取宠物的经验表"""
    global PET_EXP
    sql = "SELECT * FROM tb_pet_experience"
    result = dbpool.fetchAll(sql)
    for exp in result:
        PET_EXP[exp['level']] = exp['ExpRequired']
Exemplo n.º 9
0
def getExperience_Config():
    """获取经验配置表信息"""
    global tb_Experience_config
    sql = "select * from tb_experience"
    result = dbpool.fetchAll(sql)
    for _item in result:
        tb_Experience_config[_item['level']] = _item
Exemplo n.º 10
0
def getAllMonsterInfo():
    """获取所有怪物的信息
    """
    global All_MonsterInfo
    sql = "SELECT * FROM tb_monster"
    result = dbpool.fetchAll(sql)
    for monster in result:
        All_MonsterInfo[monster['id']] = monster
Exemplo n.º 11
0
def getFriendTopLevel(characterId, index, limit=20):
    """获取好友的等级排行
    """
    sql = "SELECT id,nickname,level,coin \
    FROM tb_character WHERE `id`!=%d ORDER BY level LIMIT %d,%d;" % (
        characterId, index, limit)
    result = dbpool.fetchAll(sql)
    return result
Exemplo n.º 12
0
def getCharacterBattleLog(characterId):
    """获取角色战斗日志
    """
    sql = "SELECT * from tb_arena_log where tiaozhan = %d \
    or yingzhan = %d order by recordtime desc limit 0,5;" % (characterId,
                                                             characterId)
    result = dbpool.fetchAll(sql)
    return result
Exemplo n.º 13
0
def getPetTrainConfig():
    """获取宠物培养配置信息"""
    global PET_TRAIN_CONFIG
    sql = "SELECT * FROM tb_pet_training "
    result = dbpool.fetchAll(sql)
    for train in result:
        PET_TRAIN_CONFIG[train['quality']] = train
    return result
Exemplo n.º 14
0
def getPetTrainConfig():
    """获取宠物培养配置信息"""
    global PET_TRAIN_CONFIG
    sql = "SELECT * FROM tb_pet_training "
    result = dbpool.fetchAll(sql)
    for train in result:
        PET_TRAIN_CONFIG[train["quality"]] = train
    return result
Exemplo n.º 15
0
def getAllCharacterTop(index, limit=20):
    """获取全服的排行信息
    """
    sql = "SELECT id,nickname,`level`,coin FROM\
     tb_character ORDER BY guanqia LIMIT %d,%d;" % (index, limit)
    result = dbpool.fetchAll(sql)

    return result
Exemplo n.º 16
0
def getFriendTopGuanqia(characterId, index, limit=20):
    """获取好友的关卡排行
    """
    sql = "SELECT id,nickname,`level`,coin FROM tb_character WHERE\
     `id`!=%d ORDER BY guanqia LIMIT %d,%d;" % (characterId, index, limit)
    result = dbpool.fetchAll(sql)

    return result
Exemplo n.º 17
0
def getAll_ItemTemplate():
    """获取所有的物品信息
    """
    global all_ItemTemplate
    sql="select * from `tb_item_template`"
    result = dbpool.fetchAll(sql)
    for _item in result:
        all_ItemTemplate[_item['id']] = _item
Exemplo n.º 18
0
def getAllCharacterTop(index,limit=20):
    """获取全服的排行信息
    """
    sql = "SELECT id,nickname,`level`,coin FROM\
     tb_character ORDER BY guanqia LIMIT %d,%d;"%(index,limit)
    result = dbpool.fetchAll(sql)

    return result
Exemplo n.º 19
0
def getAll_ItemTemplate():
    """获取所有的物品信息
    """
    global all_ItemTemplate
    sql = "select * from `tb_item_template`"
    result = dbpool.fetchAll(sql)
    for _item in result:
        all_ItemTemplate[_item['id']] = _item
Exemplo n.º 20
0
def getFriendTopGuanqia(characterId,index,limit=20):
    """获取好友的关卡排行
    """
    sql = "SELECT id,nickname,`level`,coin FROM tb_character WHERE\
     `id`!=%d ORDER BY guanqia LIMIT %d,%d;"%(characterId,index,limit)
    result = dbpool.fetchAll(sql)

    return result
Exemplo n.º 21
0
def getAllMonsterInfo():
    """获取所有怪物的信息
    """
    global All_MonsterInfo
    sql = "SELECT * FROM tb_monster"
    result = dbpool.fetchAll(sql)
    for monster in result:
        All_MonsterInfo[monster['id']] = monster
Exemplo n.º 22
0
def getAllZhanYiInfo():
    """获取所有战役的信息
    """
    global ALL_ZHANYI_INFO
    sql = "SELECT * FROM tb_zhanyi"
    result = dbpool.fetchAll(sql)

    for zhanyi in result:
        ALL_ZHANYI_INFO[zhanyi['id']] = zhanyi
Exemplo n.º 23
0
def getAllsetInfo():
    """获取所有的套装信息
    """
    global ALL_SETINFO
    sql = "SELECT * from tb_equipmentset;"
    result = dbpool.fetchAll(sql)

    for setinfo in result:
        ALL_SETINFO[setinfo['id']] = setinfo
Exemplo n.º 24
0
def getAllsetInfo():
    """获取所有的套装信息
    """
    global ALL_SETINFO
    sql = "SELECT * from tb_equipmentset;"
    result = dbpool.fetchAll(sql)

    for setinfo in result:
        ALL_SETINFO[setinfo['id']] = setinfo
Exemplo n.º 25
0
def getAllZhanYiInfo():
    """获取所有战役的信息
    """
    global ALL_ZHANYI_INFO
    sql = "SELECT * FROM tb_zhanyi"
    result = dbpool.fetchAll(sql)

    for zhanyi in result:
        ALL_ZHANYI_INFO[zhanyi['id']] = zhanyi
Exemplo n.º 26
0
def getAll():
    """获取所有掉落信息"""
    global DROPOUT_CONFIG
    sql = "select * from tb_dropout"
    result = dbpool.fetchAll(sql)
    if not result:
        return None
    for item in result:
        item['itemid']=eval("["+item['itemid']+"]")
        DROPOUT_CONFIG[item['id']]=item
Exemplo n.º 27
0
def getAllBuffInfo():
    """获取所有技能的信息"""
    global ALL_BUFF_INFO
    sql = "SELECT * FROM tb_buff_info"
    result = dbpool.fetchAll(sql)

    for buff in result:
        ALL_BUFF_INFO[buff['buffId']] = buff
        effectInfo = getBuffEffect(buff['buffEffectID'])
        ALL_BUFF_INFO[buff['buffId']]['buffEffects'] = effectInfo
Exemplo n.º 28
0
def getBuffOffsetInfo():
    """获取所有buff之间效果的信息配置
    """
    global BUFF_BUFF
    sql = "SELECT * FROM tb_buff_buff"
    result = dbpool.fetchAll(sql)
    for offset in result:
        if not BUFF_BUFF.has_key(offset['buffId']):
            BUFF_BUFF[offset['buffId']] = {}
        BUFF_BUFF[offset['buffId']][offset['tbuffId']] = offset
Exemplo n.º 29
0
def getBuffAddition():
    """获取buff对技能的加成
    """
    global BUFF_SKILL
    sql = "SELECT * FROM tb_buff_skill"
    result = dbpool.fetchAll(sql)

    for addition in result:
        if not BUFF_SKILL.has_key(addition['buffId']):
            BUFF_SKILL[addition['buffId']] = {}
        BUFF_SKILL[addition['buffId']][addition['skillId']] = addition['addition']
Exemplo n.º 30
0
def getAll():
    """获取所有翻译信息"""
    sql = "SELECT * FROM tb_language"
    result = dbpool.fetchAll(sql)

    if not result:
        return None
    data = {}
    for item in result:
        data[item['id']] = item['content']
    return data
Exemplo n.º 31
0
def getAll():
    """获取所有翻译信息"""
    sql="SELECT * FROM tb_language"
    result = dbpool.fetchAll(sql)

    if not result:
        return None
    data={}
    for item in result:
        data[item['id']]=item['content']
    return data
Exemplo n.º 32
0
def getAllLevelMail():
    """获取所有的等级邮件提示
    """
    global LEVEL_MAIL
    sql = "SELECT * FROM tb_levelmail"
    result = dbpool.fetchAll(sql)

    scenesInfo = {}
    for scene in result:
        scenesInfo[scene['level']] = scene
    LEVEL_MAIL = scenesInfo
    return scenesInfo
Exemplo n.º 33
0
def getAllZhangJieInfo():
    """获取章节的信息
    """
    global ALL_ZHANGJIE_INFO,ALL_ZHANGJIE_GROP
    sql = "SELECT * FROM tb_zhangjie"
    result = dbpool.fetchAll(sql)

    for zhangjie in result:
        ALL_ZHANGJIE_INFO[zhangjie['id']] = zhangjie
        if not ALL_ZHANGJIE_GROP.get(zhangjie['yid']):
            ALL_ZHANGJIE_GROP[zhangjie['yid']] = []
        ALL_ZHANGJIE_GROP[zhangjie['yid']].append(zhangjie['id'])
Exemplo n.º 34
0
def getAllZhangJieInfo():
    """获取章节的信息
    """
    global ALL_ZHANGJIE_INFO, ALL_ZHANGJIE_GROP
    sql = "SELECT * FROM tb_zhangjie"
    result = dbpool.fetchAll(sql)

    for zhangjie in result:
        ALL_ZHANGJIE_INFO[zhangjie['id']] = zhangjie
        if not ALL_ZHANGJIE_GROP.get(zhangjie['yid']):
            ALL_ZHANGJIE_GROP[zhangjie['yid']] = []
        ALL_ZHANGJIE_GROP[zhangjie['yid']].append(zhangjie['id'])
Exemplo n.º 35
0
def getAllLevelMail():
    """获取所有的等级邮件提示
    """
    global  LEVEL_MAIL
    sql = "SELECT * FROM tb_levelmail"
    result = dbpool.fetchAll(sql)

    scenesInfo = {}
    for scene in result:
        scenesInfo[scene['level']] = scene
    LEVEL_MAIL = scenesInfo
    return scenesInfo
Exemplo n.º 36
0
def getCharacterRivalList(ranklist):
    """获取角色的对手列表
    """
    orsql = forEachSelectORByList('b.ranking', ranklist)
    if orsql:
        sql = "SELECT b.characterId,b.ranking,\
        a.nickname,a.level,a.profession from tb_character as a,\
        tb_arena as b where a.id=b.characterId and (%s) order by `ranking`;"%(orsql)
        result = dbpool.fetchAll(sql)
        return result
    else:
        return []
Exemplo n.º 37
0
def getFirendListByFlg(pid,flg):
    """获取角色的所有好友或者黑名单
    @param pid: int 角色id
    @param flg: int 1好友   2黑名单
    """
    sql = "SELECT playerId FROM tb_friend WHERE characterId=%s AND friendType=%s"%(pid,flg)
    result = dbpool.fetchAll(sql)
    if not result:
        return []
    listdata=[]
    for item in result:
        listdata.append(item['playerId'])
    return listdata
Exemplo n.º 38
0
def getGuYongList(pid):
    """获取角色的所有好友或者黑名单
    @param pid: int 角色id
    """
    sql="SELECT playerId FROM tb_friend WHERE characterId=%s AND guyong=1"%(pid)
    result = dbpool.fetchAll(sql)

    if not result:
        return []
    listdata=[]
    for item in result:
        listdata.append(item['playerId'])
    return listdata
Exemplo n.º 39
0
def getCharacterRivalList(ranklist):
    """获取角色的对手列表
    """
    orsql = forEachSelectORByList('b.ranking', ranklist)
    if orsql:
        sql = "SELECT b.characterId,b.ranking,\
        a.nickname,a.level,a.profession from tb_character as a,\
        tb_arena as b where a.id=b.characterId and (%s) order by `ranking`;" % (
            orsql)
        result = dbpool.fetchAll(sql)
        return result
    else:
        return []
Exemplo n.º 40
0
def getAllPetGrowthConfig():
    """获取宠物成长配置
    """
    global PET_GROWTH
    sql = "SELECT * FROM tb_pet_growth"
    result = dbpool.fetchAll(sql)

    for growthconfig in result:
        attrType = growthconfig['pettype']
        quality = growthconfig['quality']
        if not PET_GROWTH.has_key(attrType):
            PET_GROWTH[attrType] = {}
        PET_GROWTH[attrType][quality] = growthconfig
Exemplo n.º 41
0
def getAllPetGrowthConfig():
    """获取宠物成长配置
    """
    global PET_GROWTH
    sql = "SELECT * FROM tb_pet_growth"
    result = dbpool.fetchAll(sql)

    for growthconfig in result:
        attrType = growthconfig["pettype"]
        quality = growthconfig["quality"]
        if not PET_GROWTH.has_key(attrType):
            PET_GROWTH[attrType] = {}
        PET_GROWTH[attrType][quality] = growthconfig
Exemplo n.º 42
0
def getGuYongList(pid):
    """获取角色的所有好友或者黑名单
    @param pid: int 角色id
    """
    sql = "SELECT playerId FROM tb_friend WHERE characterId=%s AND guyong=1" % (
        pid)
    result = dbpool.fetchAll(sql)

    if not result:
        return []
    listdata = []
    for item in result:
        listdata.append(item['playerId'])
    return listdata
Exemplo n.º 43
0
def getFirendListByFlg(pid, flg):
    """获取角色的所有好友或者黑名单
    @param pid: int 角色id
    @param flg: int 1好友   2黑名单
    """
    sql = "SELECT playerId FROM tb_friend WHERE characterId=%s AND friendType=%s" % (
        pid, flg)
    result = dbpool.fetchAll(sql)
    if not result:
        return []
    listdata = []
    for item in result:
        listdata.append(item['playerId'])
    return listdata
Exemplo n.º 44
0
def getPlayerSavMailList(characterId,page,limit):
    """获取角色邮件列表
    @param characterId: int 角色的id
    """
    filedList = ['id','title','type','isReaded','sendTime','content']
    sqlstr = ''
    sqlstr = forEachQueryProps(sqlstr, filedList)
    sql = "select %s from `tb_mail` where receiverId = %d and `isSaved`=1\
     order by isReaded LIMIT %d,%d "%(sqlstr,characterId,(page-1)*limit,limit)
    result = dbpool.fetchAll(sql)

    data = []
    for mail in result:
        mailInfo = {}
        for i in range(len(mail)):
            mailInfo[filedList[i]] = mail[i]
        data.append(mailInfo)
    return data
Exemplo n.º 45
0
def getAllPetTemplate():
    """获取宠物的模板信息"""
    global PET_TEMPLATE, shopAll, shopXy, PET_TYPE
    sql = "SELECT * FROM tb_pet_template ORDER BY `level` , `id`;"
    result = dbpool.fetchAll(sql)

    for pet in result:
        attrType = pet["attrType"]
        if not PET_TYPE.has_key(attrType):
            PET_TYPE[attrType] = []
        PET_TYPE[attrType].append(pet["id"])
        PET_TEMPLATE[pet["id"]] = pet

        if pet["coin"] > 0:
            zi = pet["baseQuality"]
            shopAll[zi].append(pet["id"])
        if pet["xy"] > 0:
            shopXy.append(pet)
Exemplo n.º 46
0
def getAllPetTemplate():
    """获取宠物的模板信息"""
    global PET_TEMPLATE, shopAll, shopXy, PET_TYPE
    sql = "SELECT * FROM tb_pet_template ORDER BY `level` , `id`;"
    result = dbpool.fetchAll(sql)

    for pet in result:
        attrType = pet['attrType']
        if not PET_TYPE.has_key(attrType):
            PET_TYPE[attrType] = []
        PET_TYPE[attrType].append(pet['id'])
        PET_TEMPLATE[pet['id']] = pet

        if pet['coin'] > 0:
            zi = pet['baseQuality']
            shopAll[zi].append(pet['id'])
        if pet['xy'] > 0:
            shopXy.append(pet)
Exemplo n.º 47
0
def getPlayerSavMailList(characterId, page, limit):
    """获取角色邮件列表
    @param characterId: int 角色的id
    """
    filedList = ['id', 'title', 'type', 'isReaded', 'sendTime', 'content']
    sqlstr = ''
    sqlstr = forEachQueryProps(sqlstr, filedList)
    sql = "select %s from `tb_mail` where receiverId = %d and `isSaved`=1\
     order by isReaded LIMIT %d,%d " % (sqlstr, characterId,
                                        (page - 1) * limit, limit)
    result = dbpool.fetchAll(sql)

    data = []
    for mail in result:
        mailInfo = {}
        for i in range(len(mail)):
            mailInfo[filedList[i]] = mail[i]
        data.append(mailInfo)
    return data
Exemplo n.º 48
0
def getPlayerAllMailList(characterId):
    """获取角色邮件列表
    @param characterId: int 角色的id
    """
    filedList = ['id','sender','title','type','isReaded','sendTime']
    sqlstr = ''
    sqlstr = forEachQueryProps(sqlstr, filedList)
    sql = "select %s from `tb_mail` where receiverId = %d  and isSaved = 0\
     order by isReaded ,sendTime desc"%(sqlstr,characterId)
    result = dbpool.fetchAll(sql)

    data = []
    for mail in result:
        mailInfo = {}
        for i in range(len(mail)):
            if filedList[i]=='sendTime':
                mailInfo['sendTime'] = str(mail[i])
            else:
                mailInfo[filedList[i]] = mail[i]
        data.append(mailInfo)
    return data
Exemplo n.º 49
0
def getPlayerAllMailList(characterId):
    """获取角色邮件列表
    @param characterId: int 角色的id
    """
    filedList = ['id', 'sender', 'title', 'type', 'isReaded', 'sendTime']
    sqlstr = ''
    sqlstr = forEachQueryProps(sqlstr, filedList)
    sql = "select %s from `tb_mail` where receiverId = %d  and isSaved = 0\
     order by isReaded ,sendTime desc" % (sqlstr, characterId)
    result = dbpool.fetchAll(sql)

    data = []
    for mail in result:
        mailInfo = {}
        for i in range(len(mail)):
            if filedList[i] == 'sendTime':
                mailInfo['sendTime'] = str(mail[i])
            else:
                mailInfo[filedList[i]] = mail[i]
        data.append(mailInfo)
    return data
Exemplo n.º 50
0
def getAllSkill():
    """初始化技能信息
    #职业技能组
    #技能池
    #技能组
    """
    global  ALL_SKILL_INFO,SKILL_GROUP,PROFESSION_SKILLGROUP
    sql = "SELECT * FROM tb_skill_info"
    result = dbpool.fetchAll(sql)

    for skill in result:
        effectInfo = getSkillEffectByID(skill['effect'])
        skill['effect'] = effectInfo
        ALL_SKILL_INFO[skill['skillId']] = skill
        if not SKILL_GROUP.has_key(skill['skillGroup']):
            SKILL_GROUP[skill['skillGroup']] = {}
        SKILL_GROUP[skill['skillGroup']][skill['level']] = skill
    #初始化职业技能组ID
    for groupID in SKILL_GROUP:
        skillInfo = SKILL_GROUP[groupID].get(1)
        profession = skillInfo.get('profession',0)
        if not PROFESSION_SKILLGROUP.has_key(profession):
            PROFESSION_SKILLGROUP[profession] = []
        PROFESSION_SKILLGROUP[profession].append(groupID)
Exemplo n.º 51
0
def getAll_ShieldWord():
    global SHIELDWORD
    sql = "SELECT sword FROM tb_shieldword;"
    result = dbpool.fetchAll(sql)
    SHIELDWORD = result
Exemplo n.º 52
0
def getGuyongRecord(characterId):
    sql = "SELECT * FROM tb_guyong_record WHERE \
    characterId = %d ORDER BY reocrddate DESC LIMIT 0,10;"%(characterId)
    result = dbpool.fetchAll(sql)
    return result
Exemplo n.º 53
0
def getGuyongRecord(characterId):
    sql = "SELECT * FROM tb_guyong_record WHERE \
    characterId = %d ORDER BY reocrddate DESC LIMIT 0,10;" % (characterId)
    result = dbpool.fetchAll(sql)
    return result
Exemplo n.º 54
0
def getVIPExp():
    global VIPEXP
    sql = "SELECT * FROM tb_vipexp"
    result = dbpool.fetchAll(sql)
    for vipp in result:
        VIPEXP[vipp['viplevel']] = vipp['maxexp']