From 0bc7e584e0e9191a9d53798bfca9170bdb92b895 Mon Sep 17 00:00:00 2001 From: Andrew Date: Thu, 1 Sep 2022 10:29:47 -0400 Subject: [PATCH 1/3] Wrap sock.recv in try/execpt to stop failure --- app/classes/minecraft/mc_ping.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/classes/minecraft/mc_ping.py b/app/classes/minecraft/mc_ping.py index edc28325..1daa7b3c 100644 --- a/app/classes/minecraft/mc_ping.py +++ b/app/classes/minecraft/mc_ping.py @@ -121,7 +121,10 @@ def ping(ip, port): i = 0 j = 0 while True: - k = sock.recv(1) + try: + k = sock.recv(1) + except: + return 0 if not k: return 0 k = k[0] From 3bdaec78376e101e1a84952f507e3bd594e51005 Mon Sep 17 00:00:00 2001 From: Iain Powrie Date: Sat, 3 Sep 2022 16:40:59 +0000 Subject: [PATCH 2/3] Apply 1 suggestion(s) to 1 file(s) --- app/classes/minecraft/mc_ping.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/classes/minecraft/mc_ping.py b/app/classes/minecraft/mc_ping.py index 1daa7b3c..039e8359 100644 --- a/app/classes/minecraft/mc_ping.py +++ b/app/classes/minecraft/mc_ping.py @@ -123,10 +123,10 @@ def ping(ip, port): while True: try: k = sock.recv(1) + if not k: + raise Exception() except: return 0 - if not k: - return 0 k = k[0] i |= (k & 0x7F) << (j * 7) j += 1 From 469428d48d13b0ac2f7c09c4b89fa769e9546fe0 Mon Sep 17 00:00:00 2001 From: Zedifus Date: Sun, 4 Sep 2022 21:52:33 +0100 Subject: [PATCH 3/3] Update changelog !444 --- CHANGELOG.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 34eeafa9..9f560cfc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,10 +7,9 @@ - Fix performance issues on server metrics panels 'with metrics range' ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/440)) ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/448)) - Fix no id on import3 servers ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/442)) - Fix functionality of bedrock update ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/441)) +- Fix mc-ping Traceback ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/444)) ### Tweaks - Flatten input on password resets ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/447)) -### Lang -TBD

## --- [4.0.11] - 2022/08/28