From: Vincent Le Gallic Date: Sat, 19 Jan 2013 02:15:45 +0000 (+0100) Subject: Nouveau protocole X-Git-Url: http://gitweb.pimeys.fr/?a=commitdiff_plain;h=fe716a175a98d4b569d8e6deb9a8bf0e98ef873f;p=NK2015_Client_Python_Alpha.git Nouveau protocole --- 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):