本文整理汇总了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}
示例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}