diff --git a/Canguru/tentandop.py b/Canguru/tentandop.py index d2c30172021ffa2f0c8d138476f459be6a666581..11178035d658d0ed75490ff595bed47495d3c4ee 100755 --- a/Canguru/tentandop.py +++ b/Canguru/tentandop.py @@ -187,11 +187,11 @@ def server (): RECEBIDA = 1 #Erro no envio - if (msg[1] == '3' and int(MACHINE_ID) == int(protocolDescompactMessage.destiny)): + elif (msg[1] == '3' and int(MACHINE_ID) == int(protocolDescompactMessage.destiny)): RECEBIDA = 0 #A msg e pra mim - if (msg[1] == '1' and int(MACHINE_ID) == int(protocolDescompactMessage.destiny)): + elif (msg[1] == '1' and int(MACHINE_ID) == int(protocolDescompactMessage.destiny)): #protocolDescompactMessage.crc = "8888888"#caga tdo if (protocolDescompactMessage.crc == protocolDescompactMessage.getCRC32()): print '\n' + protocolDescompactMessage.origin + ' Escreveu: ' + protocolDescompactMessage.msg @@ -211,7 +211,7 @@ def server (): udp.sendto (msg, dest) #A msg n e pra mim - elif (msg[1] == '1'): + elif (msg[1] == '1' or msg[2] == '2' or msg[3] == '3'): udp.sendto (msg, dest) #Recebi o token @@ -233,6 +233,8 @@ print 'ID Dessa maquina, escolha entre 1 e 4' MACHINE_ID = raw_input () print "Ip da proxima maquina" HOST = raw_input() +if TOKEN == 1: + StartTime = time.time() threadServer = threading.Thread(target=server) threadClient = threading.Thread(target=client) threadToken = threading.Thread(target=token)