当前位置: 首页>>代码示例>>Python>>正文


Python PlayersManager.formatInfo方法代码示例

本文整理汇总了Python中app.scense.core.PlayersManager.PlayersManager.formatInfo方法的典型用法代码示例。如果您正苦于以下问题:Python PlayersManager.formatInfo方法的具体用法?Python PlayersManager.formatInfo怎么用?Python PlayersManager.formatInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在app.scense.core.PlayersManager.PlayersManager的用法示例。


在下文中一共展示了PlayersManager.formatInfo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: getPlayerInfo

# 需要导入模块: from app.scense.core.PlayersManager import PlayersManager [as 别名]
# 或者: from app.scense.core.PlayersManager.PlayersManager import formatInfo [as 别名]
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}
开发者ID:joyfish,项目名称:crossapp-demo,代码行数:14,代码来源:playerInfo.py

示例2: GetOtherRoleInfo

# 需要导入模块: from app.scense.core.PlayersManager import PlayersManager [as 别名]
# 或者: from app.scense.core.PlayersManager.PlayersManager import formatInfo [as 别名]
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}
开发者ID:joyfish,项目名称:crossapp-demo,代码行数:25,代码来源:playerInfo.py


注:本文中的app.scense.core.PlayersManager.PlayersManager.formatInfo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。