Example #1
0
 def get(self):
     user = users.get_current_user()
     if user:
         cards1 = draft_backend.new_sealed()
         cards2 = draft_backend.new_sealed()
         game = Game()
         game.player1 = user
         game.life1 = 20
         game.life2 = 20
         random.shuffle(cards1)
         random.shuffle(cards2)
         game.library1 = cards1[7:]
         game.library2 = cards2[7:]
         game.hand1 = cards1[:7]
         game.hand2 = cards2[:7]
         game.graveyard1 = []
         game.graveyard2 = []
         game.put()
         self.redirect('/')
     else:
         url = users.create_login_url(self.request.uri)
         template_values = {'url': url}
         path = os.path.join(os.path.dirname(__file__), 'logged_out.html')
         self.response.out.write(template.render(path, template_values))
Example #2
0
 def get(self):
     user = users.get_current_user()
     if user:
         cards1 = draft_backend.new_sealed()
         cards2 = draft_backend.new_sealed()
         game = Game()
         game.player1 = user
         game.life1 = 20
         game.life2 = 20
         random.shuffle(cards1)
         random.shuffle(cards2)
         game.library1 = cards1[7:]
         game.library2 = cards2[7:]
         game.hand1 = cards1[:7]
         game.hand2 = cards2[:7]
         game.graveyard1 = []
         game.graveyard2 = []
         game.put()
         self.redirect("/")
     else:
         url = users.create_login_url(self.request.uri)
         template_values = {"url": url}
         path = os.path.join(os.path.dirname(__file__), "logged_out.html")
         self.response.out.write(template.render(path, template_values))
Example #3
0
 def get(self):
     user = users.get_current_user()
     if user:
         cards = draft_backend.new_sealed()
         deck = Deck()
         deck.cards = []
         deck.sideboard = sorted(cards)
         deck.name = "New Sealed Draft"
         deck.owner = user
         deck.put()
         self.redirect('/')
     else:
         url = users.create_login_url(self.request.uri)
         template_values = {'url': url}
         path = os.path.join(os.path.dirname(__file__), 'logged_out.html')
         self.response.out.write(template.render(path, template_values))
Example #4
0
 def get(self):
     user = users.get_current_user()
     if user:
         cards = draft_backend.new_sealed()
         deck = Deck()
         deck.cards = []
         deck.sideboard = sorted(cards)
         deck.name = "New Sealed Draft"
         deck.owner = user
         deck.put()
         self.redirect("/")
     else:
         url = users.create_login_url(self.request.uri)
         template_values = {"url": url}
         path = os.path.join(os.path.dirname(__file__), "logged_out.html")
         self.response.out.write(template.render(path, template_values))