chatHandler.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*-----------------------------------------------
  2. *本文件由代码生成器自动生成,
  3. *千万不要修改本文件的任何代码,
  4. *修改的的任何代码都会被覆盖掉!
  5. --------------------------------------------------*/
  6. var async = require('asyncawait/async');
  7. var await = require('asyncawait/await');
  8. var ChatHandler = function(socket){
  9. this.socket = socket;
  10. }
  11. ChatHandler.prototype.sendChatRequest = async(function(c2s_scope,c2s_content,c2s_acceptRoleId){
  12. return await(this.socket.requestAsync('chat.chatHandler.sendChatRequest',{c2s_scope:c2s_scope,c2s_content:c2s_content,c2s_acceptRoleId:c2s_acceptRoleId}));
  13. });
  14. ChatHandler.prototype.getSaveChatMsgRequest = async(function(c2s_scope,c2s_index,c2s_uid){
  15. return await(this.socket.requestAsync('chat.chatHandler.getSaveChatMsgRequest',{c2s_scope:c2s_scope,c2s_index:c2s_index,c2s_uid:c2s_uid}));
  16. });
  17. ChatHandler.prototype.crossChatSwitchButtonRequest = async(function(isAllServerChat,optype){
  18. return await(this.socket.requestAsync('chat.chatHandler.crossChatSwitchButtonRequest',{isAllServerChat:isAllServerChat,optype:optype}));
  19. });
  20. ChatHandler.prototype.onOnChatPush = function(cb){
  21. this.socket.on('chat.chatPush.onChatPush',cb);
  22. }
  23. ChatHandler.prototype.onOnChatErrorPush = function(cb){
  24. this.socket.on('chat.chatPush.onChatErrorPush',cb);
  25. }
  26. ChatHandler.prototype.onTipPush = function(cb){
  27. this.socket.on('chat.chatPush.tipPush',cb);
  28. }
  29. module.exports = ChatHandler;