From fe716a175a98d4b569d8e6deb9a8bf0e98ef873f Mon Sep 17 00:00:00 2001 From: Vincent Le Gallic Date: Sat, 19 Jan 2013 03:15:45 +0100 Subject: [PATCH] Nouveau protocole --- client.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/client.py b/client.py index 3a72202..297e76d 100755 --- a/client.py +++ b/client.py @@ -64,22 +64,22 @@ def checkidentity(a): raise KeyboardInterrupt("Imposteur !") def hello(socket,version): - socket.send('hello "%s"'%(version)) + socket.send('["hello", "%s"]' % (version)) return lit(a) def login(socket,user,mdp="",typ="bdd"): if user in ["20-100","moibdd","#1"]: - a.write('login ["#1","plop","bdd",[[],[],false]]') + a.write('["login", ["#1","plop","bdd",[[],[],false]]]') elif user in ["vincent","moi"]: - a.write('login ["vincent","plop","special",[]]') + a.write('["login", ["vincent","plop","special",[]]]') elif user in ["toto"]: - a.write('login ["toto","plop","bdd",[[],[],false]]') + a.write('["login", ["toto","plop","bdd",[[],[],false]]]') else: - a.write('login ["%s","%s","%s",[[],[],false]]'%(user,mdp,typ)) + a.write('["login", ["%s","%s","%s",[[],[],false]]]'%(user,mdp,typ)) return lit(a) def search(socket,term): - a.write("search %s"%(term)) + a.write('["search", %s]' % (term)) return lit(a) def lit(socket): -- 2.39.2