beerchat/init.lua

76 lines
2.1 KiB
Lua
Raw Normal View History

--
-- Mod settings -- Change these to your liking
2020-01-18 06:09:05 -08:00
2021-03-14 20:22:10 -07:00
local http = QoS and QoS(minetest.request_http_api(), 1) or minetest.request_http_api()
2020-01-18 06:09:05 -08:00
2019-08-04 23:33:20 -07:00
beerchat = {
-- The main channel is the one you send messages to when no channel is specified
2021-04-07 08:37:44 -07:00
main_channel_name = minetest.settings:get("beerchat.main_channel_name") or "main",
-- Chat administrator privilege allows bypassing owner checks
admin_priv = minetest.settings:get("beerchat.admin_priv") or "server",
2019-08-04 23:33:20 -07:00
-- The default color of channels when no color is specified
default_channel_color = "#ffffff",
2019-08-04 23:33:20 -07:00
-- Global flag to enable/ disable sounds
enable_sounds = true,
-- how loud the sounds should be by default (0.0 = low, 1.0 = max)
sounds_default_gain = 0.3,
2019-08-04 23:33:20 -07:00
-- General sound when managing channels like /cc, /dc etc
channel_management_sound = "beerchat_chirp",
2019-08-04 23:33:20 -07:00
-- Sound when a message is sent to a channel
channel_message_sound = "beerchat_chime",
2019-08-04 23:33:20 -07:00
main_channel_message_string = "|#${channel_name}| <${from_player}> ${message}",
2020-11-20 09:56:21 -08:00
moderator_channel_name = minetest.settings:get("beerchat.moderator_channel_name"),
2019-08-06 03:59:42 -07:00
mod_storage = minetest.get_mod_storage(),
2019-08-04 23:33:20 -07:00
channels = {},
playersChannels = {},
2020-01-18 06:09:05 -08:00
currentPlayerChannel = {},
-- web settings
url = minetest.settings:get("beerchat.matterbridge_url") or "http://127.0.0.1:4242",
token = minetest.settings:get("beerchat.matterbridge_token"),
2020-01-18 06:09:05 -08:00
2020-03-09 04:53:46 -07:00
-- mapped remote users (irc, discord)
-- data: local user => remote user
remote_username_map = {}
}
2019-08-04 23:33:20 -07:00
local MP = minetest.get_modpath("beerchat")
2021-04-06 10:30:25 -07:00
dofile(MP.."/router.lua")
2019-11-12 09:37:39 -08:00
dofile(MP.."/common.lua")
2019-08-05 00:08:41 -07:00
dofile(MP.."/format_message.lua")
dofile(MP.."/hooks.lua")
2019-08-04 23:33:20 -07:00
dofile(MP.."/storage.lua")
dofile(MP.."/session.lua")
2019-08-05 09:41:58 -07:00
dofile(MP.."/message.lua")
2019-08-04 23:33:20 -07:00
dofile(MP.."/chatcommands.lua")
if http and beerchat.token then
2020-01-18 06:09:05 -08:00
-- load web stuff
print("[beerchat] connecting to proxy-endpoint at: " .. beerchat.url)
2020-01-18 06:24:08 -08:00
dofile(MP.."/web/command.lua")
dofile(MP.."/web/register.lua")
2020-09-11 12:09:44 -07:00
dofile(MP.."/web/audit.lua")
2020-03-09 04:53:46 -07:00
dofile(MP.."/web/login.lua")
dofile(MP.."/web/logout.lua")
dofile(MP.."/web/common.lua")
loadfile(MP.."/web/tx.lua")(http)
loadfile(MP.."/web/rx.lua")(http)
2020-01-18 06:09:05 -08:00
end
2021-04-06 10:30:25 -07:00
-- Load beerchat extensions
dofile(MP.."/plugin/init.lua")