本文整理汇总了Python中models.Match.setup_soloqueue_match方法的典型用法代码示例。如果您正苦于以下问题:Python Match.setup_soloqueue_match方法的具体用法?Python Match.setup_soloqueue_match怎么用?Python Match.setup_soloqueue_match使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.Match
的用法示例。
在下文中一共展示了Match.setup_soloqueue_match方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _trigger_played_match
# 需要导入模块: from models import Match [as 别名]
# 或者: from models.Match import setup_soloqueue_match [as 别名]
def _trigger_played_match(self, match_type):
if MatchSoloQueue.query(MatchSoloQueue.type == match_type).count() >= 2:
match_solo_queues = [match_queue for match_queue in MatchSoloQueue.query(MatchSoloQueue.type == match_type).fetch(10)]
players = [match_queue.player.get() for match_queue in match_solo_queues]
match = Match(type=match_type)
match.setup_soloqueue_match(players)
ndb.delete_multi([queue.key for queue in match_solo_queues])
for player in players:
player.doing = match.key
player.put()
websocket_notify_player("Player_MatchFound", player.key, None, match.get_data())