2017-07-14 00:04:37 +02:00
|
|
|
|
|
|
|
--
|
|
|
|
-- Mod settings -- Change these to your liking
|
|
|
|
|
2020-01-18 15:09:05 +01:00
|
|
|
|
|
|
|
local http = minetest.request_http_api()
|
|
|
|
|
2019-08-05 08:33:20 +02:00
|
|
|
beerchat = {
|
|
|
|
-- The main channel is the one you send messages to when no channel is specified
|
2020-02-11 08:25:42 +01:00
|
|
|
main_channel_name = minetest.settings:get("beerchat.main_channel_name"),
|
2017-07-14 00:04:37 +02:00
|
|
|
|
2019-08-05 08:33:20 +02:00
|
|
|
-- The default color of channels when no color is specified
|
|
|
|
default_channel_color = "#ffffff",
|
2017-07-14 00:04:37 +02:00
|
|
|
|
2019-08-05 08:33:20 +02:00
|
|
|
-- Global flag to enable/ disable sounds
|
|
|
|
enable_sounds = true,
|
2017-07-14 00:04:37 +02:00
|
|
|
|
2019-11-12 20:26:08 +01:00
|
|
|
-- how loud the sounds should be by default (0.0 = low, 1.0 = max)
|
|
|
|
sounds_default_gain = 0.3,
|
|
|
|
|
2019-08-05 08:33:20 +02:00
|
|
|
-- General sound when managing channels like /cc, /dc etc
|
|
|
|
channel_management_sound = "beerchat_chirp",
|
2017-07-14 00:04:37 +02:00
|
|
|
|
2019-08-05 08:33:20 +02:00
|
|
|
-- Sound when a message is sent to a channel
|
|
|
|
channel_message_sound = "beerchat_chime",
|
2017-07-14 00:04:37 +02:00
|
|
|
|
2019-08-05 08:33:20 +02:00
|
|
|
main_channel_message_string = "|#${channel_name}| <${from_player}> ${message}",
|
2017-07-14 00:04:37 +02:00
|
|
|
|
2020-11-20 18:56:21 +01:00
|
|
|
moderator_channel_name = minetest.settings:get("beerchat.moderator_channel_name"),
|
2020-11-20 18:47:20 +01:00
|
|
|
|
2019-08-06 12:59:42 +02:00
|
|
|
mod_storage = minetest.get_mod_storage(),
|
|
|
|
|
2019-08-05 08:33:20 +02:00
|
|
|
channels = {},
|
|
|
|
playersChannels = {},
|
2020-01-18 15:09:05 +01:00
|
|
|
currentPlayerChannel = {},
|
|
|
|
|
|
|
|
-- web settings
|
|
|
|
url = minetest.settings:get("beerchat.url") or "http://127.0.0.1:8080",
|
2020-03-09 12:53:46 +01:00
|
|
|
http = http, -- will be removed after init
|
2020-01-18 15:09:05 +01:00
|
|
|
|
2020-03-09 12:53:46 +01:00
|
|
|
-- mapped remote users (irc, discord)
|
|
|
|
-- data: local user => remote user
|
|
|
|
remote_username_map = {}
|
2017-07-14 00:04:37 +02:00
|
|
|
}
|
|
|
|
|
2020-02-11 08:25:42 +01:00
|
|
|
if nil == beerchat.main_channel_name or "" == beerchat.main_channel_name then
|
|
|
|
beerchat.main_channel_name = "main"
|
|
|
|
end
|
|
|
|
|
2019-08-05 08:33:20 +02:00
|
|
|
local MP = minetest.get_modpath("beerchat")
|
2019-11-12 18:37:39 +01:00
|
|
|
dofile(MP.."/common.lua")
|
2019-08-05 09:08:41 +02:00
|
|
|
dofile(MP.."/format_message.lua")
|
2019-08-08 09:51:39 +02:00
|
|
|
dofile(MP.."/hooks.lua")
|
2019-08-05 08:33:20 +02:00
|
|
|
dofile(MP.."/storage.lua")
|
|
|
|
dofile(MP.."/session.lua")
|
|
|
|
dofile(MP.."/pm.lua")
|
|
|
|
dofile(MP.."/hash.lua")
|
|
|
|
dofile(MP.."/me.lua")
|
|
|
|
dofile(MP.."/whisper.lua")
|
2019-08-05 18:41:58 +02:00
|
|
|
dofile(MP.."/message.lua")
|
2019-08-05 08:33:20 +02:00
|
|
|
dofile(MP.."/chatcommands.lua")
|
2017-07-14 00:04:37 +02:00
|
|
|
|
2020-01-18 15:24:08 +01:00
|
|
|
if beerchat.http then
|
2020-01-18 15:09:05 +01:00
|
|
|
-- load web stuff
|
2020-01-18 15:24:08 +01:00
|
|
|
print("beerchat connects to proxy-endpoint at: " .. beerchat.url)
|
|
|
|
|
2020-01-18 15:09:05 +01:00
|
|
|
dofile(MP.."/web/executor.lua")
|
|
|
|
dofile(MP.."/web/tx.lua")
|
2020-09-11 21:09:44 +02:00
|
|
|
dofile(MP.."/web/audit.lua")
|
2020-01-18 15:09:05 +01:00
|
|
|
dofile(MP.."/web/rx.lua")
|
2020-03-09 12:53:46 +01:00
|
|
|
dofile(MP.."/web/login.lua")
|
|
|
|
dofile(MP.."/web/logout.lua")
|
|
|
|
dofile(MP.."/web/common.lua")
|
|
|
|
dofile(MP.."/web/tan.lua")
|
2020-01-18 15:09:05 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
-- remove http ref
|
|
|
|
beerchat.http = nil
|
|
|
|
|
2020-02-12 00:33:12 +02:00
|
|
|
-- integrated extensions (could also be different mod)
|
2020-02-16 22:13:58 +01:00
|
|
|
if minetest.settings:get_bool("beerchat.enable_jail") then
|
2021-01-20 21:42:51 +02:00
|
|
|
dofile(MP.."/plugin/jail.lua")
|
2020-02-12 00:33:12 +02:00
|
|
|
end
|
2017-07-24 00:56:57 +02:00
|
|
|
|
2020-08-18 19:01:02 +03:00
|
|
|
if minetest.settings:get_bool("beerchat.enable_cleaner") then
|
2021-01-20 21:42:51 +02:00
|
|
|
dofile(MP.."/plugin/cleaner.lua")
|
2020-08-18 19:01:02 +03:00
|
|
|
end
|
|
|
|
|
2021-01-20 21:42:51 +02:00
|
|
|
dofile(MP.."/plugin/override.lua")
|
|
|
|
|
2020-05-25 13:01:33 +02:00
|
|
|
if minetest.settings:get_bool("enable_beerchat_integration_test") then
|
|
|
|
dofile(MP.."/integration_test.lua")
|
|
|
|
end
|
|
|
|
|
|
|
|
|
2019-08-05 08:33:20 +02:00
|
|
|
print("[OK] beerchat")
|
2020-11-20 18:47:20 +01:00
|
|
|
|