]> gitweb.pimeys.fr Git - NK2015_Client_Python_Alpha.git/commitdiff
Nouveau protocole
authorVincent Le Gallic <legallic@crans.org>
Sat, 19 Jan 2013 02:15:45 +0000 (03:15 +0100)
committerVincent Le Gallic <legallic@crans.org>
Sat, 19 Jan 2013 02:15:45 +0000 (03:15 +0100)
client.py

index 3a722028d9eab00d3248a245b83f3f0a29ecd7fe..297e76d741a4179cafc3df4b18a4efb0ad454e24 100755 (executable)
--- 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):