mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
working towards usable new structure
This commit is contained in:
parent
3afc2fa66e
commit
815c63009f
15 changed files with 223 additions and 84 deletions
33
app/Bootstrap/Channel.js
Executable file
33
app/Bootstrap/Channel.js
Executable file
|
|
@ -0,0 +1,33 @@
|
|||
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;
|
||||
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue