shuiguoRemote.js 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. 'use strict';
  2. var P = require('quick-pomelo').Promise;
  3. var util = require('util');
  4. var logger = require('quick-pomelo').logger.getLogger('fhmj', __filename);
  5. var Remote = function (app) {
  6. this.app = app;
  7. };
  8. module.exports = function (app) {
  9. return new Remote(app);
  10. };
  11. Remote.prototype.leaveTable = function (playerId, cb) {
  12. console.warn("Remote leaveTable");
  13. var app = this.app;
  14. return app.memdb.goose.transactionAsync(function () {
  15. return app.controllers.shuiguo.leaveTableAsync(playerId);
  16. }, app.getServerId())
  17. .then(res => (app.event.emit('transactionSuccess'), res), res => (app.event.emit('transactionFail'), res))
  18. .nodeify(cb);
  19. };
  20. // Remote.prototype.creatTable = function (creatData, cb) {
  21. // var app = this.app;
  22. // return app.memdb.goose.transactionAsync(function () {
  23. // return app.controllers.shuiguo.createTableAsync(creatData.playerId,creatData.round,creatData.type,creatData.gameKind,creatData.playerAllCount,creatData.upId,creatData.other,creatData.agentId);
  24. // }, app.getServerId())
  25. // .then(res => (app.event.emit('transactionSuccess'), res), res => (app.event.emit('transactionFail'), res))
  26. // .nodeify(cb);
  27. // };