1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-09-30 08:20:32 +02:00

Merge patch 1 for IRC

- Added doc
- Changed two lines in init.lua

Patch 2 will concern the beginning of the irc submodule.
This commit is contained in:
LeMagnesium 2015-02-19 21:00:15 +01:00
parent 2d1da02c17
commit 35aef2e04d
3 changed files with 47 additions and 22 deletions

10
mods/irc/init.lua Executable file → Normal file
View File

@ -13,13 +13,12 @@ package.path =
-- 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/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..
";/usr/share/lua/5.1/?.lua"..
";/usr/share/lua/5.1/?/init.lua"
package.cpath = package.cpath..
-- ";/usr/lib/lua/5.1/?.so"
";/usr/lib/x86_64-linux-gnu/lua/5.1/?.so"
package.cpath = package.cpath..
";/usr/lib/lua/5.1/?.so"
end
irc = {
@ -104,9 +103,6 @@ function irc:connect()
return
end
print("== This is a debug line, please check for it ==")
print(self.config.NSPass)
print("=== DEBUG FINISHED ===")
if self.config.NSPass then
self:say("NickServ", "IDENTIFY "..self.config.NSPass)
end

15
mods/irc/irc/.travis.yml Normal file
View 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
View File

@ -1,7 +1,7 @@
--- LuaIRC is a low-level IRC library for Lua.
-- 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/>
--<code>
--require "irc"<br/>
@ -24,11 +24,12 @@
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>.
-- 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)
--- Hook a function to an event.
@ -46,10 +47,10 @@ function irc:unhook(name, id)
--- Connect <code>irc</code> to an IRC server.
-- @param host Host address.
-- @param port Server port. [default 6667]
function irc:connect(server, port)
function irc:connect(host, port)
-- @param table Table of connection details
-- @see Connection
-- @see ConnectOptions
function irc:connect(table)
--- Disconnect <code>irc</code> from the server.
@ -116,16 +117,26 @@ function irc:handle(msg)
function irc:shutdown()
--- Table with connection information.
-- <ul>
-- <li><code>host</code> - Server host name.</li>
-- <li><code>port</code> - Server port. [defaults to <code>6667</code>]</li>
-- <li><code>timeout</code> - Connect timeout. [defaults to <code>30</code>]</li>
-- <li><code>password</code> - Server password.</li>
-- <li><code>secure</code> - Boolean to enable TLS connection, pass a params table (described, [luasec]) to control</li>
-- </ul>
-- @name ConnectOptions
-- @class table
-- @field host Server host name.
-- @field port Server port. [defaults to <code>6667</code>]
-- @field timeout Connect timeout. [defaults to <code>30</code>]
-- @field password Server password.
-- @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
--- Class representing a connection.
-- @name Connection
-- @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.
-- @name Message
@ -145,8 +156,8 @@ function irc:shutdown()
--- List of hooks you can use with irc:hook.
-- The parameter list describes the parameters passed to the callback function.
-- <ul>
-- <li><code>PreRegister(connection)</code>Useful for CAP commands and SASL.</li>
-- <li><code>OnRaw(line) - (any non false/nil return value assumes line handled and will not be further processed)</code></li>
-- <li><code>PreRegister()</code> - Usefull for requesting capabilities.</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>OnDisconnect(message, errorOccurred)</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>OnChannelMode(user, channel, modes)</code></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>
-- * Event also invoked for yourself.
-- † Channel passed only when user tracking is enabled