/*----------------------------------------------- *本文件由代码生成器自动生成, *千万不要修改本文件的任何代码, *修改的的任何代码都会被覆盖掉! --------------------------------------------------*/ using System.IO; using System; using System.Collections.Generic; using System.Linq; using System.Text; using Pomelo.DotNetClient; namespace pomelo.area { public class NpcHandler { private PomeloClient _socket; public RecoverByNpcResponse lastRecoverByNpcResponse { get { return _socket.GetLastResponse(); } } public XiuzhenDalaoLotteryResponse lastXiuzhenDalaoLotteryResponse { get { return _socket.GetLastResponse(); } } public CheckDalaoIsCanLotteryResponse lastCheckDalaoIsCanLotteryResponse { get { return _socket.GetLastResponse(); } } public GetDreamWorkInfoResponse lastGetDreamWorkInfoResponse { get { return _socket.GetLastResponse(); } } public AddDreamWorkResponse lastAddDreamWorkResponse { get { return _socket.GetLastResponse(); } } static NpcHandler() { EventTypes.RegistRequestType("area.npcHandler.recoverByNpcRequest", typeof(RecoverByNpcRequest), typeof(RecoverByNpcResponse)); EventTypes.RegistRequestType("area.npcHandler.xiuzhenDalaoLotteryRequest", typeof(XiuzhenDalaoLotteryRequest), typeof(XiuzhenDalaoLotteryResponse)); EventTypes.RegistRequestType("area.npcHandler.checkDalaoIsCanLotteryRequest", typeof(CheckDalaoIsCanLotteryRequest), typeof(CheckDalaoIsCanLotteryResponse)); EventTypes.RegistRequestType("area.npcHandler.getDreamWorkInfoRequest", typeof(GetDreamWorkInfoRequest), typeof(GetDreamWorkInfoResponse)); EventTypes.RegistRequestType("area.npcHandler.addDreamWorkRequest", typeof(AddDreamWorkRequest), typeof(AddDreamWorkResponse)); } public NpcHandler(PomeloClient socket) { this._socket = socket; } public void recoverByNpcRequest(string npcObjId,Action cb,object option = null) { var request = new RecoverByNpcRequest(); request.npcObjId= npcObjId; _socket.request(request, (object msg, out int s2c_code, out string s2c_msg) => { var rsp = msg as RecoverByNpcResponse; s2c_code = rsp.s2c_code; s2c_msg = rsp.s2c_msg; return s2c_code == 200; }, cb, option); } public void xiuzhenDalaoLotteryRequest(int id,int select,Action cb,object option = null) { var request = new XiuzhenDalaoLotteryRequest(); request.id= id; request.select= select; _socket.request(request, (object msg, out int s2c_code, out string s2c_msg) => { var rsp = msg as XiuzhenDalaoLotteryResponse; s2c_code = rsp.s2c_code; s2c_msg = rsp.s2c_msg; return s2c_code == 200; }, cb, option); } public void checkDalaoIsCanLotteryRequest(int npcid,Action cb,object option = null) { var request = new CheckDalaoIsCanLotteryRequest(); request.npcid= npcid; _socket.request(request, (object msg, out int s2c_code, out string s2c_msg) => { var rsp = msg as CheckDalaoIsCanLotteryResponse; s2c_code = rsp.s2c_code; s2c_msg = rsp.s2c_msg; return s2c_code == 200; }, cb, option); } public void getDreamWorkInfoRequest(Action cb,object option = null) { var request = new GetDreamWorkInfoRequest(); _socket.request(request, (object msg, out int s2c_code, out string s2c_msg) => { var rsp = msg as GetDreamWorkInfoResponse; s2c_code = rsp.s2c_code; s2c_msg = rsp.s2c_msg; return s2c_code == 200; }, cb, option); } public void addDreamWorkRequest(int dreamWorkId,Action cb,object option = null) { var request = new AddDreamWorkRequest(); request.dreamWorkId= dreamWorkId; _socket.request(request, (object msg, out int s2c_code, out string s2c_msg) => { var rsp = msg as AddDreamWorkResponse; s2c_code = rsp.s2c_code; s2c_msg = rsp.s2c_msg; return s2c_code == 200; }, cb, option); } } }