From 41dc6bfab38cabc2e2aa6ec5c78f878fafa0d108 Mon Sep 17 00:00:00 2001 From: Test_User Date: Mon, 17 Jun 2024 18:40:14 -0400 Subject: Lua CoupServ improvements --- CoupServ.lua | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'CoupServ.lua') diff --git a/CoupServ.lua b/CoupServ.lua index 20ee42e..71b3408 100755 --- a/CoupServ.lua +++ b/CoupServ.lua @@ -48,7 +48,7 @@ function has_permission(user, privs) privs = privs or {} for _, v in pairs(privs) do if v == "Admin" then - if user.opertype ~= "Admin" then + if user.opertype ~= config.opertypes.admin then return false end elseif v == "Owner" then -- not dealing with this yet, so just always return false for now @@ -79,7 +79,7 @@ while true do ::continue:: local s = socket.tcp4() - s:connect("irc.andrewyu.org", 7005) + s:connect(config.address, config.port) local con = ssl.wrap(s, {mode = "client", protocol = "tlsv1_3"}) if not con:dohandshake() then @@ -90,13 +90,13 @@ while true do local time = tostring(os.time()) - con:send("SERVER hax.irc.andrewyu.org "..config.send_password.." 0 1HC :HaxServ\n") + con:send("SERVER lua.hax.irc.andrewyu.org "..config.send_password.." 0 "..config.sid.." :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") + con:send("UID "..config.sid.."000000 "..time.." "..config.nick.." "..config.hostmask.." "..config.hostmask.." HaxServ 192.168.1.1 "..time.." +k :HaxServ\n") + con:send(":"..config.sid.."000000 OPERTYPE NetAdmin\n") - userlist["1HC000000"] = { - server = "1HC", + userlist[config.sid.."000000"] = { + server = config.sid, nick_ts = time, nick = config.nick, hostname = config.hostmask, @@ -113,8 +113,8 @@ while true do } for channel, _ in pairs(config.channels) do - con:send("FJOIN "..channel.." "..time.." + :,1HC000000\n") - con:send("MODE "..channel.." +o 1HC000000\n") + con:send("FJOIN "..channel.." "..time.." + :,"..config.sid.."000000\n") + con:send("MODE "..channel.." +o "..config.sid.."000000\n") end con:send("ENDBURST\n") -- cgit v1.2.3