/*----------------------------------------------- *本文件由代码生成器自动生成, *千万不要修改本文件的任何代码, *修改的的任何代码都会被覆盖掉! --------------------------------------------------*/ using System.IO; using System; using System.Collections.Generic; using System.Linq; using System.Text; using Pomelo.DotNetClient; namespace pomelo.area { public class MountHandler { private PomeloClient _socket; public ActiveMountSkinResponse lastActiveMountSkinResponse { get { return _socket.GetLastResponse(); } } public GetMountInfoResponse lastGetMountInfoResponse { get { return _socket.GetLastResponse(); } } public RidingMountResponse lastRidingMountResponse { get { return _socket.GetLastResponse(); } } public ChooseFirstSkinResponse lastChooseFirstSkinResponse { get { return _socket.GetLastResponse(); } } static MountHandler() { EventTypes.RegistPushType("area.mountPush.mountFlagPush", typeof(MountFlagPush)); EventTypes.RegistPushType("area.mountPush.mountNewSkinPush", typeof(MountNewSkinPush)); EventTypes.RegistRequestType("area.mountHandler.activeMountSkinRequest", typeof(ActiveMountSkinRequest), typeof(ActiveMountSkinResponse)); EventTypes.RegistRequestType("area.mountHandler.getMountInfoRequest", typeof(GetMountInfoRequest), typeof(GetMountInfoResponse)); EventTypes.RegistRequestType("area.mountHandler.ridingMountRequest", typeof(RidingMountRequest), typeof(RidingMountResponse)); EventTypes.RegistRequestType("area.mountHandler.chooseFirstSkinRequest", typeof(ChooseFirstSkinRequest), typeof(ChooseFirstSkinResponse)); } public MountHandler(PomeloClient socket) { this._socket = socket; } public void activeMountSkinRequest(int c2s_skinId,Action cb,object option = null) { var request = new ActiveMountSkinRequest(); request.c2s_skinId= c2s_skinId; _socket.request(request, (object msg, out int s2c_code, out string s2c_msg) => { var rsp = msg as ActiveMountSkinResponse; s2c_code = rsp.s2c_code; s2c_msg = rsp.s2c_msg; return s2c_code == 200; }, cb, option); } public void getMountInfoRequest(Action cb,object option = null) { var request = new GetMountInfoRequest(); _socket.request(request, (object msg, out int s2c_code, out string s2c_msg) => { var rsp = msg as GetMountInfoResponse; s2c_code = rsp.s2c_code; s2c_msg = rsp.s2c_msg; return s2c_code == 200; }, cb, option); } public void ridingMountRequest(int c2s_isUp,Action cb,object option = null) { var request = new RidingMountRequest(); request.c2s_isUp= c2s_isUp; _socket.request(request, (object msg, out int s2c_code, out string s2c_msg) => { var rsp = msg as RidingMountResponse; s2c_code = rsp.s2c_code; s2c_msg = rsp.s2c_msg; return s2c_code == 200; }, cb, option); } public void chooseFirstSkinRequest(int c2s_skinId,Action cb,object option = null) { var request = new ChooseFirstSkinRequest(); request.c2s_skinId= c2s_skinId; _socket.request(request, (object msg, out int s2c_code, out string s2c_msg) => { var rsp = msg as ChooseFirstSkinResponse; s2c_code = rsp.s2c_code; s2c_msg = rsp.s2c_msg; return s2c_code == 200; }, cb, option); } public void onMountFlagPush(Action cb) { _socket.listen_once(cb); } public void onMountNewSkinPush(Action cb) { _socket.listen_once(cb); } } }