mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-22 07:28:16 +01:00
fix seed comparison: ints vs strings
Was coming in as a string when called via curl. This may be a problem for other ints if I go with lots of params instead of a json, which is looking less likely.
This commit is contained in:
parent
d0dd7a2c02
commit
d1e6a0d1d3
1 changed files with 7 additions and 4 deletions
|
@ -28,12 +28,15 @@ PRX_GET_MSGS = 4
|
|||
# now? [Note: much of this is PENDING]
|
||||
|
||||
def join(req, devID, room, seed, hid = 0, lang = 1, nInGame = 2, nHere = 1, inviteID = None):
|
||||
assert hid <= 4
|
||||
seed = int(seed)
|
||||
assert seed != 0
|
||||
|
||||
connname = None
|
||||
logs = [] # for debugging
|
||||
con = psycopg2.connect(database='xwgames')
|
||||
cur = con.cursor()
|
||||
|
||||
assert hid <= 4
|
||||
assert seed != 0
|
||||
# cur.execute('LOCK TABLE games IN ACCESS EXCLUSIVE MODE')
|
||||
|
||||
# First see if there's a game with a space for me. Must match on
|
||||
# room, lang and size. Must have room OR must have already given a
|
||||
|
@ -95,7 +98,7 @@ def join(req, devID, room, seed, hid = 0, lang = 1, nInGame = 2, nHere = 1, invi
|
|||
con.commit()
|
||||
con.close()
|
||||
|
||||
result = {'connname': connname, 'hid' : hid}
|
||||
result = {'connname': connname, 'hid' : hid, 'log' : ':'.join(logs)}
|
||||
|
||||
return json.dumps(result)
|
||||
|
||||
|
|
Loading…
Reference in a new issue