本文整理汇总了Python中dialog.Dialog.player_id方法的典型用法代码示例。如果您正苦于以下问题:Python Dialog.player_id方法的具体用法?Python Dialog.player_id怎么用?Python Dialog.player_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dialog.Dialog
的用法示例。
在下文中一共展示了Dialog.player_id方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: execute
# 需要导入模块: from dialog import Dialog [as 别名]
# 或者: from dialog.Dialog import player_id [as 别名]
def execute(self, source, target):
if not target:
return "Player name not specified"
player_id = target[0].lower()
if Context.instance.sm.player_session_map.get(player_id): #@UndefinedVariable
return "Player " + player_id + " logged in, cannot delete."
todie = self.load_object(Player, player_id)
if todie:
if todie.imm_level >= source.imm_level:
return "Cannot delete player of same or lower level."
confirm_dialog = Dialog(DIALOG_TYPE_CONFIRM, "Are you sure you want to permanently remove " + todie.name, "Confirm Delete", self.finish_delete)
confirm_dialog.player_id = player_id
return DialogMessage(confirm_dialog)
return "Player " + player_id + " does not exist."