chuck.js/app/Bootstrap/Channel.js
2012-07-28 13:26:05 +02:00

34 lines
No EOL
788 B
JavaScript
Executable file

define([
"Game/Server/Channel",
"Game/Server/CoordinatorLink"
],
function(Channel, CoordinatorLink) {
function ChannelBootstrap(process) {
var coordinatorLink = new CoordinatorLink(process);
var channel = null;
process.on('message', function(message) {
switch(message){
case 'CREATE':
channel = new Channel(coordinatorLink);
break;
case 'KILL':
channel.destroy();
process.exit(0);
break;
default:
coordinatorLink.receive(message);
break;
}
});
}
return ChannelBootstrap;
});