mirror of
https://github.com/spiffcode/hostile-takeover.git
synced 2026-04-07 02:51:30 -06:00
Leaderboard fixes for latest GAE
This commit is contained in:
parent
20706d0f36
commit
43a537b4ae
@ -7,13 +7,13 @@ from google.appengine.ext import webapp
|
||||
class AddGameStats(webapp.RequestHandler):
|
||||
def post(self):
|
||||
hash = self.request.body[:32]
|
||||
json = self.request.body[32:]
|
||||
m = md5(json + config.ADDGAMESTATS_SECRET)
|
||||
j = self.request.body[32:]
|
||||
m = md5(j + config.ADDGAMESTATS_SECRET)
|
||||
if m.hexdigest() != hash:
|
||||
return
|
||||
|
||||
# Update player_stats without dids
|
||||
g = gamestats.GameStats(json, load_players=True)
|
||||
g = gamestats.GameStats(j, load_players=True)
|
||||
|
||||
# Don't save games that only have anonymous players
|
||||
if g.get_nonanonymous_human_count() != 0:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
application: htleaderboard
|
||||
version: 11
|
||||
version: 12
|
||||
runtime: python27
|
||||
threadsafe: no
|
||||
api_version: 1
|
||||
|
||||
@ -102,9 +102,9 @@ PLAYER_DEFAULT_RATING = 1500
|
||||
DURATION_SECS_MINIMUM = 60 * 3
|
||||
|
||||
class GameStats(wrap.DictWrap):
|
||||
def __init__(self, json, viewing_player_name='', load_players=False):
|
||||
super(GameStats, self).__init__(json.loads(json))
|
||||
self.json = json
|
||||
def __init__(self, j, viewing_player_name='', load_players=False):
|
||||
super(GameStats, self).__init__(json.loads(j))
|
||||
self.json = j
|
||||
self.viewing_player_name = viewing_player_name
|
||||
|
||||
# Prune out non-contributing players
|
||||
|
||||
Loading…
Reference in New Issue
Block a user