Beispiel #1
0
def getPlayerInfo(dynamicId, characterId):
    """获取角色信息
    @param dynamicId: int 客户端的id
    @param characterId: int 角色的id
    """
    player = PlayersManager().getPlayerByID(characterId)
    if not player:
        return {"result": False, "message": Lg().g(18)}
    data = player.formatInfo()
    hasBuyCount = player.afk.turnenergytimes
    info = {"playerInfo": data, "hasBuyCount": hasBuyCount}
    return {"result": True, "message": u"获取信息成功", "data": info}
Beispiel #2
0
def getPlayerInfo(dynamicId, characterId):
    '''获取角色信息
    @param dynamicId: int 客户端的id
    @param characterId: int 角色的id
    '''
    player = PlayersManager().getPlayerByID(characterId)
    if not player:
        return {'result': False, 'message': Lg().g(18)}
    data = player.formatInfo()
    hasBuyCount = player.afk.turnenergytimes
    info = {'playerInfo': data, 'hasBuyCount': hasBuyCount}
    return {'result': True, 'message': u'获取信息成功', 'data': info}
Beispiel #3
0
def GetOtherRoleInfo(dynamicId, characterId, roleId):
    """获取其他玩家的信息
    """
    #    player = PlayersManager().getPlayerByID(characterId)
    #    if not player or not player.CheckClient(dynamicId):
    #        return {'result':False,'message':Lg().g(18)}
    toplayer = PlayersManager().getPlayerByID(roleId)
    if not toplayer:
        try:
            toplayer = PlayerCharacter(roleId)
        except:
            return {"result": True, "message": Lg().g(75)}
    playerInfo = toplayer.formatInfo()
    package = toplayer.pack.getEquipmentSlot()
    #    packageItemInfo = package.getPackageItemInfo()
    equipmentList = package.getItemList()
    keys_copy = dict([(items["position"], items) for items in equipmentList])
    equipmentList_copy = []
    for position in EQUIPPOSITION:
        item = keys_copy.get(position, None)
        equipmentList_copy.append(item)
    data = {"packageItemInfo": equipmentList_copy, "playerInfo": playerInfo}
    return {"result": True, "message": u"查看角色信息", "data": data}
Beispiel #4
0
def GetOtherRoleInfo(dynamicId, characterId, roleId):
    '''获取其他玩家的信息
    '''
    #    player = PlayersManager().getPlayerByID(characterId)
    #    if not player or not player.CheckClient(dynamicId):
    #        return {'result':False,'message':Lg().g(18)}
    toplayer = PlayersManager().getPlayerByID(roleId)
    if not toplayer:
        try:
            toplayer = PlayerCharacter(roleId)
        except:
            return {'result': True, 'message': Lg().g(75)}
    playerInfo = toplayer.formatInfo()
    package = toplayer.pack.getEquipmentSlot()
    #    packageItemInfo = package.getPackageItemInfo()
    equipmentList = package.getItemList()
    keys_copy = dict([(items['position'], items) for items in equipmentList])
    equipmentList_copy = []
    for position in EQUIPPOSITION:
        item = keys_copy.get(position, None)
        equipmentList_copy.append(item)
    data = {'packageItemInfo': equipmentList_copy, 'playerInfo': playerInfo}
    return {'result': True, 'message': u'查看角色信息', 'data': data}