mirror of
https://github.com/minetest-mods/irc.git
synced 2024-12-27 17:20:20 +01:00
Testing
This commit is contained in:
parent
20490d746a
commit
6fcef72fc5
@ -9,6 +9,3 @@ rm -fr "$destdir";
|
||||
|
||||
echo cp -fr Build/irc "\"$destdir\"";
|
||||
cp -fr Build/irc "$destdir";
|
||||
|
||||
echo cp -f dists/* ~/Dropbox/Public/;
|
||||
cp -f dists/* ~/Dropbox/Public/;
|
||||
|
12
etc/publish.sh
Executable file
12
etc/publish.sh
Executable file
@ -0,0 +1,12 @@
|
||||
#! /bin/sh
|
||||
|
||||
# ONLY FOR MAINTAINER USE!!
|
||||
|
||||
cd "`dirname "$0"`";
|
||||
dir="`pwd`";
|
||||
cd ..;
|
||||
|
||||
"$dir/zipmod.sh";
|
||||
|
||||
echo cp -f dists/* ~/Dropbox/Public/;
|
||||
cp -f dists/* ~/Dropbox/Public/;
|
BIN
screenshot_2984190360.png
Normal file
BIN
screenshot_2984190360.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 822 KiB |
107
src/init.lua
107
src/init.lua
@ -85,61 +85,62 @@ end
|
||||
|
||||
minetest.register_on_joinplayer(function ( player )
|
||||
|
||||
irc.register_callback("connect", function ( )
|
||||
irc.join(mt_irc.channel);
|
||||
irc.say(mt_irc.channel, "*** "..player:get_player_name().." joined the game");
|
||||
for _,player in ipairs(minetest.get_connected_players()) do
|
||||
mt_irc.connected_players[player:get_player_name()] = mt_irc.connect_on_join;
|
||||
end
|
||||
end);
|
||||
irc.say(mt_irc.channel, "*** "..player:get_player_name().." joined the game");
|
||||
|
||||
irc.register_callback("channel_msg", function ( channel, from, message )
|
||||
if (not mt_irc.connect_ok) then return; end
|
||||
local t = {
|
||||
name=(from or "<BUG:no one is saying this>");
|
||||
message=(message or "<BUG:there is no message>");
|
||||
server=mt_irc.server;
|
||||
port=mt_irc.port;
|
||||
channel=mt_irc.channel;
|
||||
};
|
||||
local text = mt_irc.message_format_in:gsub("%$%(([^)]+)%)", t)
|
||||
for k, v in pairs(mt_irc.connected_players) do
|
||||
if (v) then minetest.chat_send_player(k, text); end
|
||||
end
|
||||
end);
|
||||
|
||||
irc.register_callback("private_msg", function ( from, message )
|
||||
if (not mt_irc.connect_ok) then return; end
|
||||
local player_to;
|
||||
local msg;
|
||||
if (message:sub(1, 1) == ">") then
|
||||
local pos = message:find(" ", 1, true);
|
||||
if (not pos) then return; end
|
||||
player_to = message:sub(2, pos - 1);
|
||||
msg = message:sub(pos + 1);
|
||||
else
|
||||
irc.say(from, 'Please use the ">username message" syntax.');
|
||||
return;
|
||||
end
|
||||
if (not mt_irc.connected_players[player_to]) then
|
||||
irc.say(from, "User `"..player_to.."' is not connected to IRC.");
|
||||
return;
|
||||
end
|
||||
local t = {
|
||||
name=(from or "<BUG:no one is saying this>");
|
||||
message=(msg or "<BUG:there is no message>");
|
||||
server=mt_irc.server;
|
||||
port=mt_irc.port;
|
||||
channel=mt_irc.channel;
|
||||
};
|
||||
local text = mt_irc.message_format_in:gsub("%$%(([^)]+)%)", t)
|
||||
minetest.chat_send_player(player_to, "PRIVATE: "..text);
|
||||
end);
|
||||
|
||||
irc.register_callback("nick_change", function ( from, old_nick )
|
||||
if (not mt_irc.connect_ok) then return; end
|
||||
end);
|
||||
end);
|
||||
|
||||
irc.register_callback("connect", function ( )
|
||||
irc.join(mt_irc.channel);
|
||||
for _,player in ipairs(minetest.get_connected_players()) do
|
||||
mt_irc.connected_players[player:get_player_name()] = mt_irc.connect_on_join;
|
||||
end
|
||||
end);
|
||||
|
||||
irc.register_callback("channel_msg", function ( channel, from, message )
|
||||
if (not mt_irc.connect_ok) then return; end
|
||||
local t = {
|
||||
name=(from or "<BUG:no one is saying this>");
|
||||
message=(message or "<BUG:there is no message>");
|
||||
server=mt_irc.server;
|
||||
port=mt_irc.port;
|
||||
channel=mt_irc.channel;
|
||||
};
|
||||
local text = mt_irc.message_format_in:gsub("%$%(([^)]+)%)", t)
|
||||
for k, v in pairs(mt_irc.connected_players) do
|
||||
if (v) then minetest.chat_send_player(k, text); end
|
||||
end
|
||||
end);
|
||||
|
||||
irc.register_callback("private_msg", function ( from, message )
|
||||
if (not mt_irc.connect_ok) then return; end
|
||||
local player_to;
|
||||
local msg;
|
||||
if (message:sub(1, 1) == ">") then
|
||||
local pos = message:find(" ", 1, true);
|
||||
if (not pos) then return; end
|
||||
player_to = message:sub(2, pos - 1);
|
||||
msg = message:sub(pos + 1);
|
||||
else
|
||||
irc.say(from, 'Please use the ">username message" syntax.');
|
||||
return;
|
||||
end
|
||||
if (not mt_irc.connected_players[player_to]) then
|
||||
irc.say(from, "User `"..player_to.."' is not connected to IRC.");
|
||||
return;
|
||||
end
|
||||
local t = {
|
||||
name=(from or "<BUG:no one is saying this>");
|
||||
message=(msg or "<BUG:there is no message>");
|
||||
server=mt_irc.server;
|
||||
port=mt_irc.port;
|
||||
channel=mt_irc.channel;
|
||||
};
|
||||
local text = mt_irc.message_format_in:gsub("%$%(([^)]+)%)", t)
|
||||
minetest.chat_send_player(player_to, "PRIVATE: "..text);
|
||||
end);
|
||||
|
||||
irc.register_callback("nick_change", function ( from, old_nick )
|
||||
if (not mt_irc.connect_ok) then return; end
|
||||
end);
|
||||
|
||||
minetest.register_on_leaveplayer(function ( player )
|
||||
|
Loading…
Reference in New Issue
Block a user