__init__.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:PyPlanet 作者: PyPlanet 项目源码 文件源码
def podium_start(self, **kwargs):
        if len(self.jukebox) == 0:
            return
        next = self.jukebox.pop(0)
        message = '$fa0The next map will be $fff{}$z$s$fa0 as requested by $fff{}$z$s$fa0.'.format(next['map'].name, next['player'].nickname)

        # Try to set the map, if not successful it might be that the map is removed while juked!
        try:
            await asyncio.gather(
                self.instance.chat(message),
                self.instance.map_manager.set_next_map(next['map'])
            )
        except Fault as e:
            # It's removed from the server.
            if 'Map not in the selection' in e.faultString or 'Map unknown' in e.faultString:
                await self.instance.chat(
                    '$fa0Setting the next map has been canceled because the map is not on the server anymore!'
                )

                # Retry the next map(s).
                await self.podium_start()
            else:
                raise
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号