Ok. Here are updated versions of bankserver and state which should better handle asynchronous trades and entities without simulators.
Then I included another file, bankConnect.em. I wrote this up to make interacting with the bank super easy.
Here are the steps:
1. On the entity you want to connect click on the bank and press enter.
2. system.require('std/bankConnect.em'); or wherever you have the file.
Take note of a couple areas of the bankConnect file.
BANKNAME and BANKPWORD are defined at the beginning and should be set to whatever you want your bank account name to appear as when trading with users/logging in.
At the bottom of the file is a place marked "DO STUFF". Right here is where the code gets if the client has indeed paid the 10 neo shekels for your service (or however much it charges). Here is where you would probably want to call whatever function sends over code/apps to the client or starts the service. It means you have successfully been paid.
Things I will work on adding:
- Automatic detection of the bank to eliminate step 1.
-Instead of the "DO STUFF' marked area I should just have an easily definable callback function this whole thing takes instead. But both are pretty minor changes and all the core functionality is there right now if you want to work on integrating something.