Skip to content
This repository was archived by the owner on Sep 25, 2018. It is now read-only.

Account data imports

t4im edited this page Dec 25, 2014 · 2 revisions

Account data imports from other mods

'bank' allows importing account data from other mods within the worldpath. In order to configure what format to import, you can set the import_path and import_type config variables in your economy.conf fitting your needs.

import_path will expect a formatstring for the nif and table imports and replace %s with the account name. The path will be relative to the worldpath.

Supported import types

  • nif (number-in-file) for accounts stored in one file per account, only containing a number for the balance
  • table for accounts stored in one table in a file per account
  • bigtable for accounts stored in one big table, containing all accounts

Examples

(you might have to change the path in some cases to reflect changed configurations)


minetest-mod-money

import_type = "bigtable"
import_path = "accounts"

money2

import_type = "nif"
import_path = "money_%s.txt"

Clean files

Other mods often like to create files unnecessarily. If you want to remove all the balance files of the former mods, that contain a certain amount (e.g. the starting money you give out to guests, even though they leave shortly after), you can use the following snipped (don't forget to adapt it to your needs):

egrep -lx "2000" *.txt | xargs rm

This deletes all .txt files in the current directory containing the number "2000"

Clone this wiki locally