From fa228bda5a9e3a8ef5cedbf7e1f670ad2c6d8220 Mon Sep 17 00:00:00 2001 From: Mystikfluu Date: Sat, 27 May 2023 21:54:40 +0200 Subject: [PATCH] add warning and info tag to bad packet message --- client.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client.py b/client.py index 2ba8b19..17b1803 100644 --- a/client.py +++ b/client.py @@ -79,13 +79,13 @@ while packets > 0 or serverhash == None: serverhash = struct.unpack("64sx", datareceived)[0] continue if len(datareceived) != max_frame_payload: - print("\nerror bad packet: wrong size",len(datareceived)) + print("\n[WARNING] bad packet: wrong size",len(datareceived)) continue seq,checksum,data = struct.unpack(f"{header}{max_payload}s", datareceived) if data_packets[seq] != None: - print("\nerror bad packet: received multiple times",seq) + print("\n[INFO] bad packet: received multiple times",seq) continue @@ -97,7 +97,7 @@ while packets > 0 or serverhash == None: #check if packet is corrupted if checksum.hex() != hashlib.sha3_512(data).digest()[:16].hex(): - print("\nerror bad packet: checksum mismatch",seq) + print("\n[WARNING] bad packet: checksum mismatch",seq) print(checksum.hex(),hashlib.sha3_512(data).digest()[:16].hex()) print(data.hex()) continue