X-Git-Url: https://git.auder.net/?p=rpsls-web.git;a=blobdiff_plain;f=server.py;h=94b37880a3a1ef0c1b67ac9885b2191fe1aba0b3;hp=61a01aa7f0632c57b8a2e95b21db26b95092fd7e;hb=f126a42e8aeb423e81043fdf07bb4a16350b4d37;hpb=1fec6616a6de8ec1f903986ec1d5f946713b63f0 diff --git a/server.py b/server.py index 61a01aa..94b3788 100644 --- a/server.py +++ b/server.py @@ -91,6 +91,16 @@ def move(sid, data): con.commit() con.close() +@sio.event +def inc_pts(sid, data): + """ Add a point to the player (who won last round) """ + con = sqlite3.connect(DB_PATH) + cur = con.cursor() + cur.execute("update Players set points=points+1 where uid=? and gid=?", + (data["uid"],data["gid"])) + con.commit() + con.close() + static_files = { '/': RPSLS_PATH + 'index.html', '/rpsls.js': RPSLS_PATH + 'rpsls.js',