Skip to content

Account

SOFe edited this page Apr 9, 2018 · 4 revisions

An account is something that represents how much money you have got. An account can be very abstract. There are different accounts types in XialotEcon, for example:

  • Bank account (how much money do you have in the bank?)
    • You may have multiple personal bank accounts, in different currencies.
    • If you can access team accounts, you will see them in your account list too.
  • Cash account (how much money can you pay immediately? Think of an account as a "wallet" instead)
    • If the Realistic Economy module is enabled, you have one cash account per wallet item.
  • Loan account (how much money do you owe? This amount will be show in negative.
    • Each account represents one loan.
  • Shop account
    • The money you earn from your shop is temporarily stored in the shop account for that shop.
  • If you enable the Plot module:
    • If you collect plot tolls, the collected fee
    • The plot itself is stored as a "non-monetary account" in the database so that it is counted when your account is analyzed with /balance

Obsolete accounts

An account can be deleted from the database if it has not been directly accessed for a long time. Ways to directly access an account include:

  • It shows up on the list of accounts when a transaction is initiated
  • It is newly created

See also

Nerdy stuff

Technical definition

Account ID

An account is uniquely identified by the accountId, which is a XOID.

Balance

An account's value is defined by a balance, which is a decimal number precise up to 1029 and precise to 10-5.

Currency

An account should only contain balance in one currency. If you have multiple currencies, create multiple accounts. The currency of the account is defined in the currency column, which is a XOID reference to the currency.

Account type

To facilitate account classification, each account should have an account type (accountType). The account type should be a dotname defined by the creator. For example, accounts created by XialotEcon's PlayerModule should have account types starting with xialotecon.player.. When an event is fired for an account, an implementation should fully handle the event if the account's type is declared by that implementation.

Owner

To facilitate analysis of an account owner's financial state, accounts are also indexed by their owners. While some accounts are very volatile and do not stick to a certain owner closely (e.g. in the Realistic Economy module, wallet item accounts might change owner easily), the implementation should try to update the account owner as appropriate so as to facilitate the financial analysis.

Touch

The last time this account has been directly accessed, used for deleting obsolete accounts.

Clone this wiki locally