Example #1
0
  def get(self):
    gid = long(self.request.get('gid'))
    eat = json.loads(self.request.get('eat'))

    points = 0
    for e in eat:
      d = Dot.get_by_id(e)
      if d:
        d.delete()
        points += 1
        da = DotAte(gid=gid, dot_id=e, timestamp=int(time.time()*1000))
        da.put()
    
    self.response.out.write(str(points * DOT_POINTS))
Example #2
0
  def get(self):
    gid = long(self.request.get('gid'))
    lat = self.request.get('lat')
    lng = self.request.get('lng')
    pacman = True
    if self.request.get('pacman') == 'false':
        pacman = False

    p = Player()
    p.gid = gid
    p.lat = long(lat)
    p.lng = long(lng)
    p.isPacman = bool(pacman)
    p.lastCheckin = long(time.time() * 1000)
    p.put()

    dotdict = Dot.dotsAsDict(gid)
    response = {'pid' : p.key().id(), 'dots' : dotdict}
    self.response.out.write(json.dumps(response))