From c3c84a3c6aa633d0833f74d6ce1c99397a7fa8e2 Mon Sep 17 00:00:00 2001 From: Test_User Date: Fri, 5 Aug 2022 00:03:52 -0400 Subject: fix missing license to old CoupServ.py --- CoupServ.lua | 36 +++++++++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) (limited to 'CoupServ.lua') diff --git a/CoupServ.lua b/CoupServ.lua index a3c8654..20ee42e 100755 --- a/CoupServ.lua +++ b/CoupServ.lua @@ -76,25 +76,51 @@ while true do userlist = {} chanlist = {} + ::continue:: + local s = socket.tcp4() s:connect("irc.andrewyu.org", 7005) local con = ssl.wrap(s, {mode = "client", protocol = "tlsv1_3"}) - print(con:dohandshake()) + if not con:dohandshake() then + socket.select(nil, nil, 5) + con:close() + goto continue + end + + local time = tostring(os.time()) con:send("SERVER hax.irc.andrewyu.org "..config.send_password.." 0 1HC :HaxServ\n") - con:send("BURST "..tostring(os.time()).."\n") - con:send("UID 1HC000000 "..tostring(os.time()).." "..config.nick.." hax.irc.andrewyu.org "..config.hostmask.." HaxServ 192.168.1.1 "..tostring(os.time()).." +k :HaxServ\n") + con:send("BURST "..time.."\n") + con:send("UID 1HC000000 "..time.." "..config.nick.." "..config.hostmask.." "..config.hostmask.." HaxServ 192.168.1.1 "..time.." +k :HaxServ\n") con:send(":1HC000000 OPERTYPE Admin\n") + + userlist["1HC000000"] = { + server = "1HC", + nick_ts = time, + nick = config.nick, + hostname = config.hostmask, + vhost = config.hostmask, + ident = "HaxServ", + ip = "192.168.1.1", + user_ts = time, + modes = { + ["k"] = true, + }, + realname = "HaxServ", + + metadata = {}, + } + for channel, _ in pairs(config.channels) do - con:send("FJOIN "..channel.." "..tostring(os.time()).." + :,1HC000000\n") + con:send("FJOIN "..channel.." "..time.." + :,1HC000000\n") con:send("MODE "..channel.." +o 1HC000000\n") end con:send("ENDBURST\n") local proceed = true while proceed do - ready, _, err = socket.select({con, stdin}, {}, 300) + ready, _, err = socket.select({con, stdin}, {}, 120) if err then con:send("") -- hack to make it properly timeout due to annoying bugs end -- cgit v1.2.3