This commit is contained in:
parent
99804fed7f
commit
6d53be98c6
1 changed files with 13 additions and 6 deletions
19
server.py
19
server.py
|
@ -13,7 +13,7 @@ identifier = "somewhere in the universe"
|
||||||
admin_nick = "admin"
|
admin_nick = "admin"
|
||||||
data_path = ""
|
data_path = ""
|
||||||
motd = """
|
motd = """
|
||||||
____ _ ___ ____ ____ _ F
|
____ _ ___ ____ ____ _
|
||||||
/ ___|___ __| | ___ _ __ __ _ _ __ ___ ___ |_ _| _ \ / ___|__ _| |_
|
/ ___|___ __| | ___ _ __ __ _ _ __ ___ ___ |_ _| _ \ / ___|__ _| |_
|
||||||
| | / _ \ / _` |/ _ \ '_ \ / _` | '_ ` _ \ / _ \ | || |_) | | / _` | __|
|
| | / _ \ / _` |/ _ \ '_ \ / _` | '_ ` _ \ / _ \ | || |_) | | / _` | __|
|
||||||
| |__| (_) | (_| | __/ | | | (_| | | | | | | __/ | || _ <| |__| (_| | |_
|
| |__| (_) | (_| | __/ | | | (_| | | | | | | __/ | || _ <| |__| (_| | |_
|
||||||
|
@ -120,6 +120,14 @@ for i in mods['command']:
|
||||||
requires[j.replace("-", "_")] = data[j]
|
requires[j.replace("-", "_")] = data[j]
|
||||||
if "sql" in i.__ircat_giveme__:
|
if "sql" in i.__ircat_giveme__:
|
||||||
requires["sql"] = config
|
requires["sql"] = config
|
||||||
|
try:
|
||||||
|
print(i.__ircat_fakeusers__)
|
||||||
|
property_list = {**property_list, **i.__ircat_fakeusers__}
|
||||||
|
for j, v in i.__ircat_fakeusers__.items():
|
||||||
|
nickname_list.append(j)
|
||||||
|
lower_nicks[j.lower()] = j
|
||||||
|
except Exception as ex:
|
||||||
|
print(str(ex))
|
||||||
commandProviders.append(i.IRCatModule(**requires))
|
commandProviders.append(i.IRCatModule(**requires))
|
||||||
sockets = {}
|
sockets = {}
|
||||||
sockets_ssl = {}
|
sockets_ssl = {}
|
||||||
|
@ -141,11 +149,10 @@ if ssl_option:
|
||||||
sockets_ssl[i].bind((i,6697))
|
sockets_ssl[i].bind((i,6697))
|
||||||
sockets_ssl[i].listen(1)
|
sockets_ssl[i].listen(1)
|
||||||
opened=True
|
opened=True
|
||||||
reserved = ["nickserv", "chanserv", "gitserv"] # Reserved nicknames
|
|
||||||
nickname_list = {} # Stores nicknames and the respective sockets
|
nickname_list = {} # Stores nicknames and the respective sockets
|
||||||
lower_nicks = {"gitserv": "GitServ", "nickserv": "NickServ"} # Nicknames in lowercase
|
lower_nicks = {"gitserv": "GitServ"} # Nicknames in lowercase
|
||||||
lower_chans = {} # Channel names in lowercase
|
lower_chans = {} # Channel names in lowercase
|
||||||
property_list = {"GitServ": {"host": "IRCatCore", "username": "IRCat", "realname": "Codename IRCat Integrated services - Updates bot", "modes": "iw", "away": False},"NickServ": {"host": "IRCatCore", "username": "IRCat", "realname": "Codename IRCat Integrated services - Login bot", "away": False, "modes": "iw"}} # Stores properties for active users and channels
|
property_list = {"GitServ": {"host": "IRCatCore", "username": "IRCat", "realname": "Updates bot", "modes": "iw", "away": False}} # Stores properties for active users and channels
|
||||||
def pinger(nick, connection):
|
def pinger(nick, connection):
|
||||||
global property_list
|
global property_list
|
||||||
while nick in property_list:
|
while nick in property_list:
|
||||||
|
@ -218,7 +225,7 @@ def session(connection, client, ip, ssl=False):
|
||||||
if "!" in pending or ":" in pending or "#" in pending or "*" in pending:
|
if "!" in pending or ":" in pending or "#" in pending or "*" in pending:
|
||||||
connection.sendall(bytes(f":{server} 432 * {pending} :Erroneus nickname\r\n","UTF-8"))
|
connection.sendall(bytes(f":{server} 432 * {pending} :Erroneus nickname\r\n","UTF-8"))
|
||||||
pending = "*"
|
pending = "*"
|
||||||
elif pending.lower() in lower_nicks or pending in reserved:
|
elif pending.lower() in lower_nicks:
|
||||||
connection.sendall(bytes(f":{server} 433 * {pending} :Nickname is already in use.\r\n","UTF-8"))
|
connection.sendall(bytes(f":{server} 433 * {pending} :Nickname is already in use.\r\n","UTF-8"))
|
||||||
pending = "*"
|
pending = "*"
|
||||||
else:
|
else:
|
||||||
|
@ -340,7 +347,7 @@ def session(connection, client, ip, ssl=False):
|
||||||
if pending2[0] == ":": pending2[1:]
|
if pending2[0] == ":": pending2[1:]
|
||||||
if "!" in pending2 or ":" in pending2 or "#" in pending2 or "*" in pending2:
|
if "!" in pending2 or ":" in pending2 or "#" in pending2 or "*" in pending2:
|
||||||
connection.sendall(bytes(f":{server} 432 {pending} {pending2} :Erroneus nickname\r\n","UTF-8"))
|
connection.sendall(bytes(f":{server} 432 {pending} {pending2} :Erroneus nickname\r\n","UTF-8"))
|
||||||
elif pending2.lower() in lower_nicks or pending2 in reserved:
|
elif pending2.lower() in lower_nicks:
|
||||||
connection.sendall(bytes(f":{server} 433 {pending} {pending2} :Nickname is already in use.\r\n","UTF-8"))
|
connection.sendall(bytes(f":{server} 433 {pending} {pending2} :Nickname is already in use.\r\n","UTF-8"))
|
||||||
else:
|
else:
|
||||||
print("Sending nickname change...")
|
print("Sending nickname change...")
|
||||||
|
|
Loading…
Add table
Reference in a new issue