mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2024-11-20 17:20:31 +01:00
Merge pull request #23 from LeMagnesium/irc_patch_1
Merge patch 1 for IRC
This commit is contained in:
commit
7bdbbf3851
10
mods/irc/init.lua
Executable file → Normal file
10
mods/irc/init.lua
Executable file → Normal file
@ -13,13 +13,12 @@ package.path =
|
|||||||
-- The build of Lua that Minetest comes with only looks for libraries under
|
-- The build of Lua that Minetest comes with only looks for libraries under
|
||||||
-- /usr/local/share and /usr/local/lib but LuaSocket is often installed under
|
-- /usr/local/share and /usr/local/lib but LuaSocket is often installed under
|
||||||
-- /usr/share and /usr/lib.
|
-- /usr/share and /usr/lib.
|
||||||
if not rawget(_G,"jit") and package.config:sub(1, 1) == "/" then
|
if not jit and package.config:sub(1, 1) == "/" then
|
||||||
package.path = package.path..
|
package.path = package.path..
|
||||||
";/usr/share/lua/5.1/?.lua"..
|
";/usr/share/lua/5.1/?.lua"..
|
||||||
";/usr/share/lua/5.1/?/init.lua"
|
";/usr/share/lua/5.1/?/init.lua"
|
||||||
package.cpath = package.cpath..
|
package.cpath = package.cpath..
|
||||||
-- ";/usr/lib/lua/5.1/?.so"
|
";/usr/lib/lua/5.1/?.so"
|
||||||
";/usr/lib/x86_64-linux-gnu/lua/5.1/?.so"
|
|
||||||
end
|
end
|
||||||
|
|
||||||
irc = {
|
irc = {
|
||||||
@ -104,9 +103,6 @@ function irc:connect()
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
print("== This is a debug line, please check for it ==")
|
|
||||||
print(self.config.NSPass)
|
|
||||||
print("=== DEBUG FINISHED ===")
|
|
||||||
if self.config.NSPass then
|
if self.config.NSPass then
|
||||||
self:say("NickServ", "IDENTIFY "..self.config.NSPass)
|
self:say("NickServ", "IDENTIFY "..self.config.NSPass)
|
||||||
end
|
end
|
||||||
|
15
mods/irc/irc/.travis.yml
Normal file
15
mods/irc/irc/.travis.yml
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
language: lua
|
||||||
|
|
||||||
|
notifications:
|
||||||
|
email: false
|
||||||
|
|
||||||
|
env:
|
||||||
|
global:
|
||||||
|
- secure: "kFhU+DZjhq/KbDt0DIDWnlskXMa12miNelmhhy30fQGgVIdiibDGKMNGyLahWp8CnPu1DARb5AZWK2TDfARdnURT2pgcsG83M7bYIY6cR647BWjL7oAhJ6CYEzTWJTBjeUjpN/o4vIgfXSDR0c7vboDi7Xz8ilfrBujPL2Oi/og="
|
||||||
|
|
||||||
|
install:
|
||||||
|
- sudo apt-get -y update
|
||||||
|
- sudo apt-get -y install lua5.1 luadoc
|
||||||
|
|
||||||
|
script:
|
||||||
|
- ./push-luadoc.sh
|
44
mods/irc/irc/doc/irc.luadoc
Executable file → Normal file
44
mods/irc/irc/doc/irc.luadoc
Executable file → Normal file
@ -1,7 +1,7 @@
|
|||||||
--- LuaIRC is a low-level IRC library for Lua.
|
--- LuaIRC is a low-level IRC library for Lua.
|
||||||
-- All functions raise Lua exceptions on error.
|
-- All functions raise Lua exceptions on error.
|
||||||
--
|
--
|
||||||
-- Use <code>new</code> to create a new IRC object.<br/>
|
-- Use <code>new</code> to create a new Connection object.<br/>
|
||||||
-- Example:<br/><br/>
|
-- Example:<br/><br/>
|
||||||
--<code>
|
--<code>
|
||||||
--require "irc"<br/>
|
--require "irc"<br/>
|
||||||
@ -24,11 +24,12 @@
|
|||||||
|
|
||||||
module "irc"
|
module "irc"
|
||||||
|
|
||||||
--- Create a new IRC object. Use <code>irc:connect</code> to connect to a server.
|
--- Create a new Connection object. Use <code>irc:connect</code> to connect to a server.
|
||||||
-- @param user Table with fields <code>nick</code>, <code>username</code> and <code>realname</code>.
|
-- @param user Table with fields <code>nick</code>, <code>username</code> and <code>realname</code>.
|
||||||
-- The <code>nick</code> field is required.
|
-- The <code>nick</code> field is required.
|
||||||
--
|
--
|
||||||
-- @return Returns a new <code>irc</code> object.
|
-- @return Returns a new Connection object.
|
||||||
|
-- @see Connection
|
||||||
function new(user)
|
function new(user)
|
||||||
|
|
||||||
--- Hook a function to an event.
|
--- Hook a function to an event.
|
||||||
@ -46,10 +47,10 @@ function irc:unhook(name, id)
|
|||||||
--- Connect <code>irc</code> to an IRC server.
|
--- Connect <code>irc</code> to an IRC server.
|
||||||
-- @param host Host address.
|
-- @param host Host address.
|
||||||
-- @param port Server port. [default 6667]
|
-- @param port Server port. [default 6667]
|
||||||
function irc:connect(server, port)
|
function irc:connect(host, port)
|
||||||
|
|
||||||
-- @param table Table of connection details
|
-- @param table Table of connection details
|
||||||
-- @see Connection
|
-- @see ConnectOptions
|
||||||
function irc:connect(table)
|
function irc:connect(table)
|
||||||
|
|
||||||
--- Disconnect <code>irc</code> from the server.
|
--- Disconnect <code>irc</code> from the server.
|
||||||
@ -116,16 +117,26 @@ function irc:handle(msg)
|
|||||||
function irc:shutdown()
|
function irc:shutdown()
|
||||||
|
|
||||||
--- Table with connection information.
|
--- Table with connection information.
|
||||||
-- <ul>
|
-- @name ConnectOptions
|
||||||
-- <li><code>host</code> - Server host name.</li>
|
-- @class table
|
||||||
-- <li><code>port</code> - Server port. [defaults to <code>6667</code>]</li>
|
-- @field host Server host name.
|
||||||
-- <li><code>timeout</code> - Connect timeout. [defaults to <code>30</code>]</li>
|
-- @field port Server port. [defaults to <code>6667</code>]
|
||||||
-- <li><code>password</code> - Server password.</li>
|
-- @field timeout Connect timeout. [defaults to <code>30</code>]
|
||||||
-- <li><code>secure</code> - Boolean to enable TLS connection, pass a params table (described, [luasec]) to control</li>
|
-- @field password Server password.
|
||||||
-- </ul>
|
-- @field secure Boolean to enable TLS connection, pass a params table (described, [luasec]) to control
|
||||||
-- [luasec]: http://www.inf.puc-rio.br/~brunoos/luasec/reference.html
|
-- [luasec]: http://www.inf.puc-rio.br/~brunoos/luasec/reference.html
|
||||||
|
|
||||||
|
--- Class representing a connection.
|
||||||
-- @name Connection
|
-- @name Connection
|
||||||
-- @class table
|
-- @class table
|
||||||
|
-- @field authed Boolean indicating whether the connection has completed registration.
|
||||||
|
-- @field connected Whether the connection is currently connected.
|
||||||
|
-- @field motd The server's message of the day. Can be nil.
|
||||||
|
-- @field nick The current nickname.
|
||||||
|
-- @field realname The real name sent to the server.
|
||||||
|
-- @field username The username/ident sent to the server.
|
||||||
|
-- @field socket Raw socket used by the library.
|
||||||
|
-- @field supports What the server claims to support in it's ISUPPORT message.
|
||||||
|
|
||||||
--- Class representing an IRC message.
|
--- Class representing an IRC message.
|
||||||
-- @name Message
|
-- @name Message
|
||||||
@ -145,8 +156,8 @@ function irc:shutdown()
|
|||||||
--- List of hooks you can use with irc:hook.
|
--- List of hooks you can use with irc:hook.
|
||||||
-- The parameter list describes the parameters passed to the callback function.
|
-- The parameter list describes the parameters passed to the callback function.
|
||||||
-- <ul>
|
-- <ul>
|
||||||
-- <li><code>PreRegister(connection)</code>Useful for CAP commands and SASL.</li>
|
-- <li><code>PreRegister()</code> - Usefull for requesting capabilities.</li>
|
||||||
-- <li><code>OnRaw(line) - (any non false/nil return value assumes line handled and will not be further processed)</code></li>
|
-- <li><code>OnRaw(line)</code> - Any non false/nil return value assumes line handled and will not be further processed.</li>
|
||||||
-- <li><code>OnSend(line)</code></li>
|
-- <li><code>OnSend(line)</code></li>
|
||||||
-- <li><code>OnDisconnect(message, errorOccurred)</code></li>
|
-- <li><code>OnDisconnect(message, errorOccurred)</code></li>
|
||||||
-- <li><code>OnChat(user, channel, message)</code></li>
|
-- <li><code>OnChat(user, channel, message)</code></li>
|
||||||
@ -162,7 +173,10 @@ function irc:shutdown()
|
|||||||
-- <li><code>OnUserMode(modes)</code></li>
|
-- <li><code>OnUserMode(modes)</code></li>
|
||||||
-- <li><code>OnChannelMode(user, channel, modes)</code></li>
|
-- <li><code>OnChannelMode(user, channel, modes)</code></li>
|
||||||
-- <li><code>OnModeChange(user, target, modes, ...)</code>* ('...' contains mode options such as banmasks)</li>
|
-- <li><code>OnModeChange(user, target, modes, ...)</code>* ('...' contains mode options such as banmasks)</li>
|
||||||
-- <li><code>DoX(msg)</code>'X' is any IRC command or numeric with the first letter capitalized (eg, DoPing and Do001)</li>
|
-- <li><code>OnCapabilityList(caps)</code></li>
|
||||||
|
-- <li><code>OnCapabilityAvailable(cap, value)</code> Called only when a capability becomes available or changes.</li>
|
||||||
|
-- <li><code>OnCapabilitySet(cap, enabled)</code>*</li>
|
||||||
|
-- <li><code>DoX(msg)</code>* - 'X' is any IRC command or numeric with the first letter capitalized (eg, DoPing and Do001)</li>
|
||||||
-- </ul>
|
-- </ul>
|
||||||
-- * Event also invoked for yourself.
|
-- * Event also invoked for yourself.
|
||||||
-- † Channel passed only when user tracking is enabled
|
-- † Channel passed only when user tracking is enabled
|
||||||
|
Loading…
Reference in New Issue
Block a user