mirror of
https://github.com/minetest-mods/irc.git
synced 2025-06-29 22:50:32 +02:00
Add "reconnect" time variable to config. (#23)
Allow server admin to specify how long until a reconnect occurs after a timeout (default 600 seconds) without having to modify the core code.
This commit is contained in:
committed by
Auke Kok
parent
464f2febee
commit
03edbd29ed
3
init.lua
3
init.lua
@ -107,6 +107,7 @@ function irc:connect()
|
||||
port = self.config.port,
|
||||
password = self.config.password,
|
||||
timeout = self.config.timeout,
|
||||
reconnect = self.config.reconnect,
|
||||
secure = self.config.secure
|
||||
})
|
||||
end)
|
||||
@ -114,7 +115,7 @@ function irc:connect()
|
||||
if not good then
|
||||
minetest.log("error", ("IRC: Connection error: %s: %s -- Reconnecting in ten minutes...")
|
||||
:format(self.config.server, message))
|
||||
minetest.after(600, function() self:connect() end)
|
||||
minetest.after(self.config.reconnect, function() self:connect() end)
|
||||
return
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user