Permalink
Browse files

sdasdas

  • Loading branch information...
1 parent 6d36682 commit 53d23fcb0b2dbeed1101ff7c9a3ab92f42185b66 @ciudilo ciudilo committed Sep 21, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 server.py
View
@@ -55,12 +55,14 @@ def player(room, facebook_id):
if request.method == 'POST':
print "adding player {0} to room {1}".format(facebook_id, room)
app.p[room].trigger('presence', {"state": "add","facebook_id": facebook_id})
- app.users[room].append(facebook_id)
+ if facebook_id not in app.users[room]:
+ app.users[room].append(facebook_id)
elif request.method == 'DELETE':
print "removing player {0} to room {1}".format(facebook_id, room)
app.p[room].trigger('presence', {"state": "del","facebook_id": facebook_id})
app.users[room].remove(facebook_id)
else:
+ print json.dumps(app.users[room])
return json.dumps(app.users[room])
return "Done"

0 comments on commit 53d23fc

Please sign in to comment.