Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Compatibility fix (string field conversion)
  • Loading branch information
nOOb3167 authored and sfan5 committed May 18, 2018
1 parent 4802010 commit e49da8f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions server.py
Expand Up @@ -209,8 +209,9 @@ def checkRequest(server):
if data[1] == "bool" and type(server[name]).__name__ == "str":
server[name] = True if server[name].lower() in ("true", "1") else False
continue
# clients_max was sent as a string instead of an integer
if name == "clients_max" and type(server[name]).__name__ == "str":
# Accept strings in integer fields but convert it to an
# integer, for interoperability with e.g. minetest.write_json.
if data[1] == "int" and type(server[name]).__name__ == "str":
server[name] = int(server[name])
continue
#### End compatibility code ####
Expand Down

0 comments on commit e49da8f

Please sign in to comment.