.BANCHO. Configurable IRC hostname

This commit is contained in:
Nyo 2016-09-04 12:36:21 +02:00
parent 2d91231320
commit d5c87ba51c
2 changed files with 4 additions and 1 deletions

View File

@ -57,6 +57,7 @@ class config:
self.config.get("irc","enable")
self.config.get("irc","port")
self.config.get("irc","hostname")
self.config.get("localize","enable")
self.config.get("localize","ipapiurl")
@ -104,6 +105,7 @@ class config:
self.config.add_section("irc")
self.config.set("irc", "enable", "1")
self.config.set("irc", "port", "6667")
self.config.set("irc", "hostname", "ripple")
self.config.add_section("localize")
self.config.set("localize", "enable", "1")

View File

@ -516,7 +516,8 @@ class Client:
class Server:
def __init__(self, port):
self.host = socket.getfqdn("127.0.0.1")[:63]
#self.host = socket.getfqdn("127.0.0.1")[:63]
self.host = glob.conf.config["irc"]["hostname"]
self.port = port
self.clients = {} # Socket --> Client instance.
self.motd = ["Welcome to pep.py's embedded IRC server!", "This is a VERY simple IRC server and it's still in beta.", "Expect things to crash and not work as expected :("]