Skip to content

Commit e49da8f

Browse files
nOOb3167sfan5
authored andcommittedMay 18, 2018
Compatibility fix (string field conversion)
1 parent 4802010 commit e49da8f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
 

Diff for: ‎server.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,9 @@ def checkRequest(server):
209209
if data[1] == "bool" and type(server[name]).__name__ == "str":
210210
server[name] = True if server[name].lower() in ("true", "1") else False
211211
continue
212-
# clients_max was sent as a string instead of an integer
213-
if name == "clients_max" and type(server[name]).__name__ == "str":
212+
# Accept strings in integer fields but convert it to an
213+
# integer, for interoperability with e.g. minetest.write_json.
214+
if data[1] == "int" and type(server[name]).__name__ == "str":
214215
server[name] = int(server[name])
215216
continue
216217
#### End compatibility code ####

0 commit comments

Comments
 (0)
Please sign in to comment.