mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
33 lines
No EOL
534 B
JavaScript
Executable file
33 lines
No EOL
534 B
JavaScript
Executable file
define([
|
|
"Game/Server/Channel"
|
|
],
|
|
|
|
function(Channel) {
|
|
|
|
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;
|
|
|
|
}); |