/*----------------------------------------------- *本文件由代码生成器自动生成, *千万不要修改本文件的任何代码, *修改的的任何代码都会被覆盖掉! --------------------------------------------------*/ using System.IO; using System; using System.Collections.Generic; using System.Linq; using System.Text; using Pomelo.DotNetClient; namespace pomelo.area { public class NpcGoodFeelingHandler { private PomeloClient _socket; public GetAllNpcGoodFeelingResponse lastGetAllNpcGoodFeelingResponse { get { return _socket.GetLastResponse(); } } public GetNpcGoodFeelingResponse lastGetNpcGoodFeelingResponse { get { return _socket.GetLastResponse(); } } public GiftGivingResponse lastGiftGivingResponse { get { return _socket.GetLastResponse(); } } public TalkResponse lastTalkResponse { get { return _socket.GetLastResponse(); } } public TalkEndSelRewardResponse lastTalkEndSelRewardResponse { get { return _socket.GetLastResponse(); } } static NpcGoodFeelingHandler() { EventTypes.RegistPushType("area.npcGoodFeelingPush.allNpcGoodFeelingGetPush", typeof(AllNpcGoodFeelingGetPush)); EventTypes.RegistPushType("area.npcGoodFeelingPush.firstTalkNpcPush", typeof(FirstTalkNpcPush)); EventTypes.RegistRequestType("area.npcGoodFeelingHandler.getAllNpcGoodFeelingRequest", typeof(GetAllNpcGoodFeelingRequest), typeof(GetAllNpcGoodFeelingResponse)); EventTypes.RegistRequestType("area.npcGoodFeelingHandler.getNpcGoodFeelingRequest", typeof(GetNpcGoodFeelingRequest), typeof(GetNpcGoodFeelingResponse)); EventTypes.RegistRequestType("area.npcGoodFeelingHandler.giftGivingRequest", typeof(GiftGivingRequest), typeof(GiftGivingResponse)); EventTypes.RegistRequestType("area.npcGoodFeelingHandler.talkRequest", typeof(TalkRequest), typeof(TalkResponse)); EventTypes.RegistRequestType("area.npcGoodFeelingHandler.talkEndSelRewardRequest", typeof(TalkEndSelRewardRequest), typeof(TalkEndSelRewardResponse)); } public NpcGoodFeelingHandler(PomeloClient socket) { this._socket = socket; } public void getAllNpcGoodFeelingRequest(Action cb,object option = null) { var request = new GetAllNpcGoodFeelingRequest(); _socket.request(request, (object msg, out int s2c_code, out string s2c_msg) => { var rsp = msg as GetAllNpcGoodFeelingResponse; s2c_code = rsp.s2c_code; s2c_msg = rsp.s2c_msg; return s2c_code == 200; }, cb, option); } public void getNpcGoodFeelingRequest(int npcId,Action cb,object option = null) { var request = new GetNpcGoodFeelingRequest(); request.npcId= npcId; _socket.request(request, (object msg, out int s2c_code, out string s2c_msg) => { var rsp = msg as GetNpcGoodFeelingResponse; s2c_code = rsp.s2c_code; s2c_msg = rsp.s2c_msg; return s2c_code == 200; }, cb, option); } public void giftGivingRequest(int npcId,pomelo.area.GiftItem gift,Action cb,object option = null) { var request = new GiftGivingRequest(); request.npcId= npcId; request.gift= gift; _socket.request(request, (object msg, out int s2c_code, out string s2c_msg) => { var rsp = msg as GiftGivingResponse; s2c_code = rsp.s2c_code; s2c_msg = rsp.s2c_msg; return s2c_code == 200; }, cb, option); } public void talkRequest(int npcId,Action cb,object option = null) { var request = new TalkRequest(); request.npcId= npcId; _socket.request(request, (object msg, out int s2c_code, out string s2c_msg) => { var rsp = msg as TalkResponse; s2c_code = rsp.s2c_code; s2c_msg = rsp.s2c_msg; return s2c_code == 200; }, cb, option); } public void talkEndSelRewardRequest(int index,int npcId,Action cb,object option = null) { var request = new TalkEndSelRewardRequest(); request.index= index; request.npcId= npcId; _socket.request(request, (object msg, out int s2c_code, out string s2c_msg) => { var rsp = msg as TalkEndSelRewardResponse; s2c_code = rsp.s2c_code; s2c_msg = rsp.s2c_msg; return s2c_code == 200; }, cb, option); } public void onAllNpcGoodFeelingGetPush(Action cb) { _socket.listen_once(cb); } public void onFirstTalkNpcPush(Action cb) { _socket.listen_once(cb); } } }