bagHandler.js 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*-----------------------------------------------
  2. *本文件由代码生成器自动生成,
  3. *千万不要修改本文件的任何代码,
  4. *修改的的任何代码都会被覆盖掉!
  5. --------------------------------------------------*/
  6. var async = require('asyncawait/async');
  7. var await = require('asyncawait/await');
  8. var BagHandler = function(socket){
  9. this.socket = socket;
  10. }
  11. BagHandler.prototype.packUpBagRequest = async(function(c2s_type){
  12. return await(this.socket.requestAsync('area.bagHandler.packUpBagRequest',{c2s_type:c2s_type}));
  13. });
  14. BagHandler.prototype.openBagGridRequest = async(function(c2s_type,c2s_number){
  15. return await(this.socket.requestAsync('area.bagHandler.openBagGridRequest',{c2s_type:c2s_type,c2s_number:c2s_number}));
  16. });
  17. BagHandler.prototype.transferItemRequest = async(function(c2s_fromType,c2s_fromIndex,c2s_toType,c2s_num){
  18. return await(this.socket.requestAsync('area.bagHandler.transferItemRequest',{c2s_fromType:c2s_fromType,c2s_fromIndex:c2s_fromIndex,c2s_toType:c2s_toType,c2s_num:c2s_num}));
  19. });
  20. BagHandler.prototype.sellItemRequest = async(function(c2s_gridIndex,c2s_num){
  21. return await(this.socket.requestAsync('area.bagHandler.sellItemRequest',{c2s_gridIndex:c2s_gridIndex,c2s_num:c2s_num}));
  22. });
  23. BagHandler.prototype.sellItemBatchRequest = async(function(c2s_gridList){
  24. return await(this.socket.requestAsync('area.bagHandler.sellItemBatchRequest',{c2s_gridList:c2s_gridList}));
  25. });
  26. BagHandler.prototype.useItemRequest = async(function(c2s_gridIndex,c2s_num){
  27. return await(this.socket.requestAsync('area.bagHandler.useItemRequest',{c2s_gridIndex:c2s_gridIndex,c2s_num:c2s_num}));
  28. });
  29. BagHandler.prototype.disintegrationRequest = async(function(c2s_gridIndex,c2s_num){
  30. return await(this.socket.requestAsync('area.bagHandler.disintegrationRequest',{c2s_gridIndex:c2s_gridIndex,c2s_num:c2s_num}));
  31. });
  32. BagHandler.prototype.addBagItemTestNotify = function(){
  33. return this.socket.notify('area.bagHandler.addBagItemTestNotify',{});
  34. };
  35. BagHandler.prototype.onBagItemUpdatePush = function(cb){
  36. this.socket.on('area.bagPush.bagItemUpdatePush',cb);
  37. }
  38. BagHandler.prototype.onBagNewItemPush = function(cb){
  39. this.socket.on('area.bagPush.bagNewItemPush',cb);
  40. }
  41. BagHandler.prototype.onBagNewEquipPush = function(cb){
  42. this.socket.on('area.bagPush.bagNewEquipPush',cb);
  43. }
  44. BagHandler.prototype.onBagGridFullPush = function(cb){
  45. this.socket.on('area.bagPush.bagGridFullPush',cb);
  46. }
  47. BagHandler.prototype.onBagGridNumPush = function(cb){
  48. this.socket.on('area.bagPush.bagGridNumPush',cb);
  49. }
  50. BagHandler.prototype.onBagNewItemFromResFubenPush = function(cb){
  51. this.socket.on('area.bagPush.bagNewItemFromResFubenPush',cb);
  52. }
  53. module.exports = BagHandler;