[WIP] Bank Accounts Mod for Luanti (redone). Forked from Tmanyo (https://github.com/Tmanyo/bank_accounts).
Find a file
2025-06-16 01:00:23 +02:00
locale Init repo with working copy from my private server 2025-06-16 01:00:23 +02:00
models Init repo with working copy from my private server 2025-06-16 01:00:23 +02:00
textures Init repo with working copy from my private server 2025-06-16 01:00:23 +02:00
atm.lua Init repo with working copy from my private server 2025-06-16 01:00:23 +02:00
card_swipe.lua Init repo with working copy from my private server 2025-06-16 01:00:23 +02:00
cards.lua Init repo with working copy from my private server 2025-06-16 01:00:23 +02:00
chatcommands.lua Init repo with working copy from my private server 2025-06-16 01:00:23 +02:00
computer.lua Init repo with working copy from my private server 2025-06-16 01:00:23 +02:00
depends.txt Init repo with working copy from my private server 2025-06-16 01:00:23 +02:00
functions.lua Init repo with working copy from my private server 2025-06-16 01:00:23 +02:00
i18n.lua Init repo with working copy from my private server 2025-06-16 01:00:23 +02:00
init.lua Init repo with working copy from my private server 2025-06-16 01:00:23 +02:00
interest.lua Init repo with working copy from my private server 2025-06-16 01:00:23 +02:00
license.txt Init repo with working copy from my private server 2025-06-16 01:00:23 +02:00
mod.conf Init repo with working copy from my private server 2025-06-16 01:00:23 +02:00
pin_terminal.lua Init repo with working copy from my private server 2025-06-16 01:00:23 +02:00
README.md Init repo with working copy from my private server 2025-06-16 01:00:23 +02:00
wtm.lua Init repo with working copy from my private server 2025-06-16 01:00:23 +02:00

Bank Accounts (Redo & Extended)

A complete overhaul and extension of the original bank_accounts mod by Tmanyo and Trent Lasich. This project has been restructured from the ground up to ensure stability, security, and a significantly expanded feature set.

About This Version

This version is a "Redo" of the original code. The focus was on fixing critical bugs, preventing exploits, and drastically improving stability, especially in multiplayer environments. Furthermore, numerous new features such as an automatic interest system, a detailed account statement, and a wire transfer machine have been added to provide a comprehensive in-game economic system.

Features Overview

  • Complete Account System: Players automatically receive an account with a balance and a credit line.
  • 5 Interactive Machines: ATM, Teller Computer, PIN Terminal, Card Swipe, and Wire Transfer Machine (WTM).
  • Detailed Account Statement: All transactions are logged and can be viewed via the ATM or Teller Computer.
  • Automatic Interest System: A performant background process calculates daily interest on balances and credit debts.
  • Secure Transactions: All actions are secured against exploits (e.g., duplication bugs) and invalid inputs.
  • API for Other Mods: Allows other mods to safely interact with the banking system.
  • Fully Translatable (i18n): All texts can be easily adapted for other languages.

Dependencies

This mod requires the Currency Mod to function.

Known Issues & WIP

This version is significantly more stable than the original mod, especially on multiplayer servers. Most critical multiplayer bugs and data loss issues have been resolved.

However, there is a known theoretical race condition that can occur under very specific circumstances:

  • If two different players interact with two different machines (e.g., two ATMs) at the exact same moment, it is possible for a transaction to be misdirected to the wrong machine.

The time window for this to occur is extremely small (typically less than a few seconds between the two players' clicks), making it a very rare event on most servers.

This is a known limitation resulting from a workaround needed to ensure stability across different Minetest clients. It is considered a work-in-progress (WIP) issue that may be addressed in future updates.

Getting Started (For Players)

To use the banking system, you first need to set your personal PIN.

  1. Find a PIN Terminal (a small, wall-mounted device).
  2. Right-click it. As a new customer, you will be prompted to set a 4-digit PIN.
  3. After successful entry, you will automatically receive your Bank Card (ATM Card) in your inventory. You will need this card to access most of the other machines.

The Machines (Nodes) in Detail

PIN Terminal

  • Purpose: The primary point of contact for new players and for PIN management.
  • Functions:
    • New Players: Are prompted to set their first, personal 4-digit PIN. They then receive their first bank card.
    • Existing Players: Can change their PIN (requires entering the old PIN for security) or request a new bank card if the old one was lost.

ATM (Automatic Teller Machine)

  • Purpose: Standard interactions with one's own account.
  • Operation: Requires a Bank Card (ATM Card) and PIN entry.
  • Functions:
    • Deposit: Deposit cash (currency items).
    • Withdrawal: Withdraw cash (integers only).
    • Pay Credit: Provides the option to pay the due rate or a custom amount of the credit debt.
    • Account Statement: Shows the transaction history for balance and credit.
    • Request Cards: Issues new debit or credit cards.

Teller Computer

  • Purpose: For players with the bank_teller privilege to manage customer accounts.
  • Functions:
    • All functions of a normal ATM, but for any customer entered by name.
    • Additional admin functions: Wipe Account and Reset PIN.
    • Admin Search (Shift + Right-click): Server admins can check if an account is seized.

Wire Transfer Machine (WTM)

  • Purpose: Secure money transfers between players.
  • Operation: Requires Bank Card and PIN.
  • Functions:
    • Transfer from your balance.
    • Transfer from your credit line.
    • Input fields for Recipient, Amount (decimals allowed), and Purpose.
    • The recipient receives a chat message about the incoming funds.
    • The transaction is logged in the account statements of both the sender and the recipient with all details.

Card Swipe

  • Purpose: Player-owned shops to sell items via card payment.
  • Functions:
    • Seller: Places the device, puts items in its inventory, and sets a price (decimals allowed).
    • Buyer: Right-clicks the device with a debit or credit card to complete the purchase. The process is theft-proof items are only transferred automatically after successful payment.

Automatic Interest System (interest.lua)

  • A performant background process calculates interest once every 24 hours (real-time).
  • The interest rates for balance (default 0.5%) and credit debt (default 3%) can be easily configured at the beginning of the interest.lua file.
  • Interest transactions are automatically logged in the account statement.

Chat Commands

All commands start with bank_.

For All Players

  • /bank_account [<playername>] - Shows your own account balance. Players with bank_teller or server privs can also view others' accounts.
  • /bank_set_pin <4-digit-PIN> - Sets your own PIN. (Replaced in function by the PIN Terminal but remains as a command).

For Admins Only (server privilege)

  • /bank_add <name> <number> - Adds money to a player's account (integers only).
  • /bank_subtract <name> <number> - Subtracts money from a player's account (integers only).
  • /bank_balance <name> <number> - Sets a player's balance to an exact value (decimals allowed).
  • /bank_credit <name> <number> - Sets a player's credit debt to an exact value (decimals allowed). /bank_credit <name> 0 forgives all debt.
  • /bank_wipe <name> - Wipes a player's account balance to 0.
  • /bank_seize <name> - Seizes a player's account (locks access).
  • /bank_unseize <name> - Unseizes an account.

Improvements Over the Original Version

  • Stability: The fundamental logic was overhauled to fix crashes and "freezing" or silently closing windows.
  • Security / Exploits: Numerous exploits have been fixed, e.g., money duplication by moving items between slots, and withdrawing fractional amounts of cash.
  • Multiplayer Capability: Almost all global variables that caused conflicts between players have been removed. The mod is now significantly more stable on servers. (Note: One global variable for position was retained for compatibility with certain Minetest clients, which could in theory cause issues with perfectly simultaneous interactions at two devices, but this is extremely unlikely in practice).
  • API: A clean and safe API in functions.lua now allows other mods to interact with the system easily and without conflicts.
  • New Features: Account Statements, Daily Interest System, Wire Transfer Machine, and the PIN Terminal have been newly added.
  • User Experience: The onboarding for new players via the PIN Terminal is much more immersive. The UI has been polished in many places.
  • Internationalization (i18n): The entire mod is now fully translatable.

License

License: MIT

Copyright 2016 Trent Lasich
Copyright 2025 Rage87

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Credits

  • Original Mod: Tmanyo (Code) & Trent Lasich (Textures, Models)
  • Complete Redo, Extension & Bugfixing: Rage87