Merge branch 'bug/mc-ping-traceback' into 'dev'

Wrap sock.recv in try/execpt to stop failure

See merge request crafty-controller/crafty-4!444
This commit is contained in:
Iain Powrie 2022-09-04 20:56:34 +00:00
commit 1ca34948cc
2 changed files with 6 additions and 4 deletions

View File

@ -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
<br><br>
## --- [4.0.11] - 2022/08/28

View File

@ -121,8 +121,11 @@ def ping(ip, port):
i = 0
j = 0
while True:
k = sock.recv(1)
if not k:
try:
k = sock.recv(1)
if not k:
raise Exception()
except:
return 0
k = k[0]
i |= (k & 0x7F) << (j * 7)