123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- module.exports = function(app) {
- return new Handler(app);
- };
- var Handler = function(app) {
- this.app = app;
- };
- /**
- * New client entry.
- *
- * @param {Object} msg request message
- * @param {Object} session current session object
- * @param {Function} next next step callback
- * @return {Void}
- */
- Handler.prototype.entry = function(msg, session, next) {
- next(null, {code: 200, msg: 'game server is ok.'});
- };
- /**
- * Publish route for mqtt connector.
- *
- * @param {Object} msg request message
- * @param {Object} session current session object
- * @param {Function} next next step callback
- * @return {Void}
- */
- Handler.prototype.publish = function(msg, session, next) {
- var result = {
- topic: 'publish',
- payload: JSON.stringify({code: 200, msg: 'publish message is ok.'})
- };
- next(null, result);
- };
- /**
- * Subscribe route for mqtt connector.
- *
- * @param {Object} msg request message
- * @param {Object} session current session object
- * @param {Function} next next step callback
- * @return {Void}
- */
- Handler.prototype.subscribe = function(msg, session, next) {
- var result = {
- topic: 'subscribe',
- payload: JSON.stringify({code: 200, msg: 'subscribe message is ok.'})
- };
- next(null, result);
- };
|