What is TorchEconomy?
Torch Economy is a collection of economy plugins for the Torch API that provides an extra layer of gameplay for Space Engineers. It is based heavily on (and makes use of)
Frontier Economy's code, expanding and modifying it to make it a server-side only modification.
- Player & NPC Currency Tracking
- Multiple bank accounts are allowed per player/NPC, with one selected as primary.
- APIGateway integration to allow client-side or other server-side modifications to interact with the economy.
- Security provided by way of a server-provided Transaction Key that can be used to sign APIGateway messages for authenticity.
- Extended gameplay provided through addon plugins.
- Fully configurable through Torch's WPF UI (with currency names, and more being tracked this way.)
- ADO.NET backend integration. All data is stored on SQL providers allowing external integration through web portals.
- Full transaction logs for every monetary exchange that takes place.
- !econ balance: Displays the balance for all accounts attached to your player.
- !econ logs <account#OrName>: Displays a transaction log for your account limited to the last 50 transactions.
- !econ accounts primary <account#OrName>: Sets the provided account # as your primary account to send/receive money from.
- !econ accounts close <account#OrName>: Closes the account # provided it has 0 money.
- !econ accounts open <accountName>: Opens a new account with the provided nickname. Players are limited to 10 of these.
- !econ transfer <playerNameOrId> <amount>: Transfers money from your primary account to the targeted player's primary account.
- !econ move <fromAccount> <toAccount> <amount>: Manually transfer money between two accounts you own.
- !admin accounts give <playerNameOrId> <amount>: Admin command to give a player money. Sends it to their primary account. Amount may be negative.
If you'd like to use MYSQL as the ADo.net data provider, it will require some setup.
- Make sure to install your MySQL server first.
- Make note of your username/password you set root as.
- Using a command line mysql client or a GUI mysql client, create an empty database. By default the name we use is 'space_engineers'.
- Configure the plugin's ConnectionString in Torch's WPF GUI, using the username/password you configured earlier. If you used a different database/schema name or port, put that here too.
- Restart Torch for good measure!
- Start the server and it should populate all the tables for you. Everything should be good now!
Using the API
Send requests to DS using the normal APIGateway (the Protobuf classes are under TorchEconomy/Messages). Messages from other mods should include the TransactionKey if ForceTransactionCheck is enabled in Torch Economy. Responses from Torch will be returned specifically to the client that requested them.
It is currently possibly to interact directly with accounts using the API if properly authorized by the server's TransactionKey.