Commit 73f0843f authored by minus's avatar minus

fixed dump_ips.py

parent 3921a9e8
#!/usr/bin/env python3
from teeworlds.teeworlds import create_masters, query_masters
from teeworlds.teeworlds import create_masters, query_masters_serverlist
from teeworlds.base import EventSocket
from teeworlds.server import Server
sock = EventSocket(idle_limit=2.0)
masterlist = create_masters(sock)
for m in masterlist:
m.on_server_add = lambda s: print(s.address)
query_masters(masterlist)
m.on_server_add = lambda s: print(s.address.host)
query_masters_serverlist(masterlist)
sock.run()
......@@ -106,7 +106,7 @@ class Server(object):
return self.address == other.address
def __str__(self):
return "<Server name='{name}' address='{address}' master='{master}'>".format(**self.__dict__)
return "<Server name='{name}' address='{address}' master='{_master}'>".format(**self.__dict__)
"""
Events
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment