diff --git a/Canguru/CanguruChat.py b/Canguru/CanguruChat.py index 731c66e145f1f0c4385f3bfdb0c5e8462355c9f1..7a46bd90733d39735ab4f9cdabc0efaf662a26fc 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-----------------#