-
Notifications
You must be signed in to change notification settings - Fork 0
Account
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
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
An account is uniquely identified by the accountId
, which is a XOID.
An account's value is defined by a balance
, which is a decimal number precise up to 1029 and precise to 10-5.
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.
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.
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.
The last time this account has been directly accessed, used for deleting obsolete accounts.