From d9df50e5729361437994a3a0ad310708153ec683 Mon Sep 17 00:00:00 2001 From: Fernando Erd <fce15@inf.ufpr.br> Date: Sun, 6 Nov 2016 16:58:34 -0200 Subject: [PATCH] Alertas de token --- Canguru/CanguruChat.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Canguru/CanguruChat.py b/Canguru/CanguruChat.py index 731c66e..7a46bd9 100755 --- a/Canguru/CanguruChat.py +++ b/Canguru/CanguruChat.py @@ -123,8 +123,6 @@ def client (): if (protocolMessage.type == 0 and TOKEN == 1): print 'Vou mandar o token' TOKEN = 0 - else: - print "ERRO, N ESTOU COM O TOKEN" udp.sendto (msg, dest) protocolMessage = Protocol() protocolMessage.setDestiny() @@ -152,11 +150,12 @@ def server (): if (protocolDescompactMessage.type == '0' and TOKEN == 0): print 'RECEBI O TOKEN' TOKEN = 1 - if protocolDescompactMessage.crc == protocolDescompactMessage.getCRC32(): - print msg - print '\n' + protocolDescompactMessage.origin + ' Escreveu: ' + protocolDescompactMessage.msg - else: - print 'ERRO, A MENSAGEM FOI RECIBIDA ERRADA' + else: + if protocolDescompactMessage.crc == protocolDescompactMessage.getCRC32(): + print msg + print '\n' + protocolDescompactMessage.origin + ' Escreveu: ' + protocolDescompactMessage.msg + else: + print 'ERRO, A MENSAGEM FOI RECIBIDA ERRADA' udp.close() #------------------MAIN-----------------# -- GitLab