¶ VariablesCopyright(c) 2012 Stefano Balietti MIT Licensed
|
(function (exports, node) {
|
¶ Constants |
|
¶ node.actionsCollection of available nodeGame actions The action adds an initial semantic meaning to the message. It specify the nature of requests "Why the message was sent?" Semantics:
|
node.action = {};
node.action.SET = 'set';
node.action.GET = 'get';
node.action.SAY = 'say'; |
¶ node.targetCollection of available nodeGame targets The target adds an additional level of semantic for the message, and specifies the nature of the information carried in the message. It answers the question: "What is the content of the message?" |
node.target = {}; |
¶ target.DATAGeneric identifier for any type of data |
node.target.DATA = 'DATA';
|
¶ target.HIA client is connecting for the first time |
node.target.HI = 'HI'; |
¶ target.HI_AGAINA client re-connects to the server within the same session |
node.target.HI_AGAIN = 'HI_AGAIN'; |
¶ target.PCONNECTA new client just connected to the player endpoint |
node.target.PCONNECT = 'PCONNECT';
|
¶ target.PDISCONNECTA client that just disconnected from the player endpoint |
node.target.PDISCONNECT = 'PDISCONNECT'; |
¶ target.MCONNECTA client that just connected to the admin (monitor) endpoint |
node.target.MCONNECT = 'MCONNECT'; |
¶ target.MDISCONNECTA client just disconnected from the admin (monitor) endpoint |
node.target.MDISCONNECT = 'MDISCONNECT'; |
¶ target.PLISTThe list of clients connected to the player endpoint was updated |
node.target.PLIST = 'PLIST';
|
¶ target.MLISTThe list of clients connected to the admin (monitor) endpoint was updated |
node.target.MLIST = 'MLIST'; |
¶ target.STATEA client notifies his own state |
node.target.STATE = 'STATE';
|
¶ target.REDIRECTRedirects a client to a new uri |
node.target.REDIRECT = 'REDIRECT'; |
¶ target.SETUPAsks a client update its configuration |
node.target.SETUP = 'SETUP';
|
¶ target.GAMECOMMANDAsk a client to start/pause/stop/resume the game |
node.target.GAMECOMMAND = 'GAMECOMMAND';
|
¶ not used targets (for future development) |
node.target.TXT = 'TXT'; // Text msg
|
Still to implement |
node.target.BYE = 'BYE'; // Force disconnects
node.target.ACK = 'ACK'; // A reliable msg was received correctly
node.target.WARN = 'WARN'; // To do.
node.target.ERR = 'ERR'; // To do. |
¶ Game commands
|
node.gamecommand = {
start: 'start',
pause: 'pause',
resume: 'resume',
stop: 'stop',
restart: 'restart',
goto_state: 'goto_state'
};
|
¶ DirectionDistiguishes between incoming and outgoing messages
|
node.IN = 'in.';
node.OUT = 'out.'; |
¶ node.isLevels associates to the states of the nodeGame engine |
node.is = {}; |
¶ is.UNKNOWNA game has not been initialized |
node.is.UNKNOWN = 0; |
¶ is.LOADINGA game is loading |
node.is.LOADING = 10;
|
¶ is.LOADEDA game has been loaded, but the GameWindow object could still require some time |
node.is.LOADED = 25;
|
¶ is.PLAYINGEverything is ready |
node.is.PLAYING = 50;
|
¶ is.DONEThe player completed the game state |
node.is.DONE = 100;
})(
'undefined' != typeof node ? node : module.exports
, 'undefined' != typeof node ? node : module.parent.exports
);
|