Bank

0 views
Skip to first unread message

Elliot Conte

unread,
Jul 28, 2011, 5:12:08 PM7/28/11
to emerso...@googlegroups.com
In order to work, state.em must be in located at std/state.em.  This is because the file is referenced in bankserver.em

Basically, to make a bank execute the following:
system.require('std/bankserver.em');
new bank();


Then clicking on the bank entity and pressing enter should result in the state.Connection class being sent over and instantiated automatically as bankConnection.  You can interact manually with the bank through messages or use the state.Connection class which wraps a lot of the message sending.  I can explain anything in particular you are trying to do.
bankserver.em
state.em

Elliot Conte

unread,
Jul 28, 2011, 5:15:13 PM7/28/11
to emerso...@googlegroups.com
For example here is a code snippet from my pacman server:


if (typeof(bankConnection) !== 'undefined') {
bankConnection.create('Pacman Server','pacman');
bankPinger = function() {
system.__debugPrint('PINGING BANK');
{action: 'updatePing'} >> bankConnection.service >> [];
};
var pingTimer =new std.core.RepeatingTimer(5, bankPinger);
}


This just creates an account with the bank with name Pacman Server and password pacman.

Elliot Conte

unread,
Jul 28, 2011, 5:15:23 PM7/28/11
to emerso...@googlegroups.com
It also logs in and stays logged in.

Elliot Conte

unread,
Jul 28, 2011, 5:20:20 PM7/28/11
to emerso...@googlegroups.com
There might be some errors right now if you try to connect to the bank with an entity where the simulator is not defined.  I believe I have fixed that though and I'll get that out later if it works.
Reply all
Reply to author
Forward
0 new messages