Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Compatibility fix (string field conversion)
- Loading branch information
Showing
with
3 additions
and
2 deletions.
-
+3
−2
server.py
|
@@ -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 #### |
|
|