Esempio n. 1
0
    def players(self):
        from core.ottd.misc import rcon
        import re
        clients_str = rcon("clients")
        result = []

        for client_str in clients_str:
            client_id, client_name, client_company, client_ip = re.match(
                "Client #(\w*)  name: '(\w*)'  company: (\w*)  IP: (\w*)",
                client_str).groups()
            if client_id != "1":
                result += [{
                    "client_id": client_id,
                    "client_name": client_name
                }]
                print(client_str)

        return result
Esempio n. 2
0
    def cmd(self, cmd):
        from core.ottd.misc import rcon
        result = rcon("%s" % cmd)

        return result
Esempio n. 3
0
    def say(self, msg):
        from core.ottd.misc import rcon
        result = rcon("say \"%s\"" % msg)

        return True
Esempio n. 4
0
    def ban_player(self, player_id):
        from core.ottd.misc import rcon
        result = rcon("ban %s" % player_id)

        return True
Esempio n. 5
0
    def kick_player(self, player_id):
        from core.ottd.misc import rcon
        result = rcon("kick %s" % player_id)

        return True