summaryrefslogtreecommitdiff
path: root/CoupServ.lua
diff options
context:
space:
mode:
authorTest_User <hax@andrewyu.org>2022-08-05 00:03:52 -0400
committerTest_User <hax@andrewyu.org>2022-08-05 00:03:52 -0400
commitc3c84a3c6aa633d0833f74d6ce1c99397a7fa8e2 (patch)
tree5ef911b7e034c5b5b9aa22b105bad5900ff4742a /CoupServ.lua
parente3d61f12fe302e7e72d97d8c718c6a372b334ff6 (diff)
downloadcoupserv-c3c84a3c6aa633d0833f74d6ce1c99397a7fa8e2.tar.gz
coupserv-c3c84a3c6aa633d0833f74d6ce1c99397a7fa8e2.zip
fix missing license to old CoupServ.py
Diffstat (limited to 'CoupServ.lua')
-rwxr-xr-xCoupServ.lua36
1 files changed, 31 insertions, 5 deletions
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