2021-07-22 22:33:41 +02:00
|
|
|
|
|
|
|
|
2024-03-28 18:37:41 +01:00
|
|
|
-- Copyright (C) 2021, 2024 Sandro del Toro
|
2021-07-22 22:33:41 +02:00
|
|
|
|
|
|
|
-- This file is part of Emeraldbank Minetest Mod.
|
|
|
|
|
|
|
|
-- Emeraldbank is free software: you can redistribute it and/or modify
|
2022-03-11 19:02:35 +01:00
|
|
|
-- it under the terms of the GNU Affero General Public License as
|
|
|
|
-- published by the Free Software Foundation, either version 3 of the
|
|
|
|
-- License, or (at your option) any later version.
|
2021-07-22 22:33:41 +02:00
|
|
|
|
|
|
|
-- Emeraldbank is distributed in the hope that it will be useful,
|
|
|
|
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2022-03-11 19:02:35 +01:00
|
|
|
-- GNU Affero General Public License for more details.
|
2021-07-22 22:33:41 +02:00
|
|
|
|
2022-03-11 19:02:35 +01:00
|
|
|
-- You should have received a copy of the GNU Affero General Public License
|
2021-07-22 22:33:41 +02:00
|
|
|
-- along with Emeraldbank. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-10-13 14:23:24 +02:00
|
|
|
local modpath = core.get_modpath(core.get_current_modname())
|
2021-07-22 22:33:41 +02:00
|
|
|
|
2021-08-07 22:39:41 +02:00
|
|
|
emeraldbank = {}
|
2021-07-22 22:33:41 +02:00
|
|
|
|
2021-10-13 14:23:24 +02:00
|
|
|
local income_enabled = core.settings:get_bool("emeraldbank.income_enabled", true)
|
2023-08-25 17:06:28 +02:00
|
|
|
local start_balance = tonumber(core.settings:get("emeraldbank.start_balance")) or 30
|
2021-07-22 22:33:41 +02:00
|
|
|
|
2023-08-25 17:06:28 +02:00
|
|
|
atm = {
|
|
|
|
balance = {},
|
|
|
|
startbalance = start_balance,
|
|
|
|
pending_transfers = {},
|
|
|
|
completed_transactions = {},
|
|
|
|
pth = minetest.get_worldpath().."/atm_accounts",
|
|
|
|
pth_wt = minetest.get_worldpath().."/atm_wt_transactions"
|
|
|
|
}
|
|
|
|
|
2023-08-30 02:58:29 +02:00
|
|
|
dofile(modpath .. "/atm.lua") -- file common.lua from atm mod
|
2023-08-25 17:06:28 +02:00
|
|
|
dofile(modpath .. "/functions.lua")
|
2023-08-30 02:58:29 +02:00
|
|
|
dofile(modpath .. "/forms.lua") -- file adapted from atm mod
|
|
|
|
dofile(modpath .. "/receive_fields.lua") -- file adapted from atm mod
|
|
|
|
dofile(modpath .. "/receive_fields_wt.lua") -- file from atm mod
|
2021-10-13 14:23:24 +02:00
|
|
|
dofile(modpath .. "/bank.lua")
|
|
|
|
dofile(modpath .. "/commands.lua")
|
2023-08-25 17:31:57 +02:00
|
|
|
|
|
|
|
if income_enabled then
|
|
|
|
dofile(modpath .. "/income.lua")
|
|
|
|
end
|
2023-08-25 17:35:40 +02:00
|
|
|
|
2023-08-30 02:58:29 +02:00
|
|
|
minetest.register_on_joinplayer(emeraldbank.update_accounts)
|