mirror of
https://github.com/chocolate-doom/master-server.git
synced 2024-11-10 07:11:38 +00:00
Encode/decode as utf8.
I believe this fixed a bug that was occurring some time back.
This commit is contained in:
parent
47da0dbd89
commit
87b5ff04ba
1 changed files with 2 additions and 2 deletions
|
@ -78,7 +78,7 @@ def read_string(packet):
|
|||
|
||||
result, = struct.unpack("%ss" % strlen, packet[0:strlen])
|
||||
|
||||
return packet[strlen + 1:], result
|
||||
return packet[strlen + 1:], result.decode('utf8')
|
||||
|
||||
class Server:
|
||||
""" A server that has registered itself. """
|
||||
|
@ -292,7 +292,7 @@ class MasterServer:
|
|||
def metadata_string(server):
|
||||
metadata = server.metadata.copy()
|
||||
metadata["age"] = server.age()
|
||||
return simplejson.dumps(metadata)
|
||||
return simplejson.dumps(metadata).encode('utf8')
|
||||
|
||||
# Generate a list of strings containing JSON-encoded metadata
|
||||
# about servers. Only include verified servers.
|
||||
|
|
Loading…
Reference in a new issue