示例#1
0
文件: api.py 项目: bschmoker/highnoon
    def create_game(self, request):
        """create a new game """

        # look up initiating player
        slinger = Player.query(Player.player_id == request.player_id).get()

        if slinger is None:
            raise endpoints.BadRequestException(
                'specified player_id not found')

        # generate new game
        game_id = uniq_id()
        game = Game(game_id=game_id, player_id=slinger.player_id)
        game.put()

        # create game history for this game
        history = History(game=game.key)
        history.put()

        return game.to_message()
示例#2
0
文件: api.py 项目: bschmoker/highnoon
    def create_player(self, request):
        """Create a Player. Optionally set a (non)unique username and email (not validated)"""

        # LATER: filter using bleach and profanity pip libs to prevent XSS and xbox live community
        # LATER: include funny response when popular slinger names are chosen

        email = None
        if request.email is not None:
            email = request.email

        player_name = None
        if request.desired_name is not None:
            player_name = request.desired_name

        player_id = uniq_id()

        player = Player(player_id=player_id,
                        player_name=player_name, player_email=email)
        player.put()

        return player.to_message()
示例#3
0
 def __init__(self):
     self.bs = 32
     self.crypt_key = uniq_id()
示例#4
0
文件: python.py 项目: w3fs/leash
 def start(self):
     session_id = uniq_id()
     open('../tmp/session_%s.py' % session_id, 'w')
     return session_id
示例#5
0
文件: python.py 项目: YxRyaB/leash
 def start(self):
     session_id = uniq_id()
     open('../tmp/session_%s.py' % session_id, 'w')
     return session_id
示例#6
0
文件: python.py 项目: roycepope/leash
 def start(self):
     session_id = uniq_id()
     open("../tmp/session_%s.py" % session_id, "w")
     return session_id