From 11c36ab211f872b01785b39f6c944d8b25821bd4 Mon Sep 17 00:00:00 2001 From: Vincent Le Gallic Date: Mon, 26 Nov 2012 21:00:27 +0100 Subject: [PATCH] =?utf8?q?Mise=20=C3=A0=20jour=20du=20protocole=20client/s?= =?utf8?q?erveur=20de=20la=20note?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- basile.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/basile.py b/basile.py index 58d8250..bccea28 100755 --- a/basile.py +++ b/basile.py @@ -75,7 +75,7 @@ def connect_NK(): # On passe en SSL sock=ssl.wrap_socket(sock,ca_certs='../keys/ca_.crt') # On fait un hello - sock.write('hello "Basile"') + sock.write('["hello", "Basile"]') # On récupère la réponse du hello out=sock.read() out=json.loads(out) @@ -97,7 +97,7 @@ def login_NK(username,password,typ="bdd"): masque='[[], [], true]' try: # Basile a un compte special user - commande='login [%s,%s,"%s",%s]'%(json.dumps(username),json.dumps(password),typ,masque) + commande='["login", [%s,%s,"%s",%s]]'%(json.dumps(username),json.dumps(password),typ,masque) sock.write(commande) out=sock.read() except Exception as exc: @@ -537,7 +537,7 @@ class Basile(ircbot.SingleServerIRCBot): if len(message)==1: if self.identities.has_key(auteur): try: - self.nk.write('search ["x",["pseudo"],%s]'%(json.dumps(self.identities[auteur]))) + self.nk.write('["search", ["x",["pseudo"],%s]]'%(json.dumps(self.identities[auteur]))) ret=json.loads(self.nk.read()) solde=ret["msg"][0]["solde"] pseudo=ret["msg"][0]["pseudo"] @@ -552,7 +552,7 @@ class Basile(ircbot.SingleServerIRCBot): serv.privmsg(canal,"Je ne connais pas ton pseudo note.") elif auteur in self.ops: try: - self.nk.write('search ["x",["pseudo"],%s]'%(json.dumps(message[1]))) + self.nk.write('["search", ["x",["pseudo"],%s]]'%(json.dumps(message[1]))) ret=json.loads(self.nk.read()) solde=ret["msg"][0]["solde"] pseudo=ret["msg"][0]["pseudo"] @@ -653,7 +653,7 @@ class Basile(ircbot.SingleServerIRCBot): if self.identities.has_key(auteur): pseudo=self.identities[auteur] try: - self.nk.write('search ["x",["pseudo"],%s]'%(json.dumps(pseudo))) + self.nk.write('["search", ["x",["pseudo"],%s]]'%(json.dumps(pseudo))) ret=json.loads(self.nk.read()) solde=ret["msg"][0]["solde"] pseudo=ret["msg"][0]["pseudo"] -- 2.39.2