123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- using System.IO;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using Pomelo.DotNetClient;
- namespace pomelo.area
- {
- public class WeekendStarDungeonHandler
- {
- private PomeloClient _socket;
- public WeekendStarDungeonEnterNpcResponse lastWeekendStarDungeonEnterNpcResponse { get { return _socket.GetLastResponse<WeekendStarDungeonEnterNpcResponse>(); } }
- public WeekendStarDungeonRecvResponse lastWeekendStarDungeonRecvResponse { get { return _socket.GetLastResponse<WeekendStarDungeonRecvResponse>(); } }
- public WeekendStarDungeonSelectTypeResponse lastWeekendStarDungeonSelectTypeResponse { get { return _socket.GetLastResponse<WeekendStarDungeonSelectTypeResponse>(); } }
- public WeekendStarDungeonRecvListResponse lastWeekendStarDungeonRecvListResponse { get { return _socket.GetLastResponse<WeekendStarDungeonRecvListResponse>(); } }
- static WeekendStarDungeonHandler()
- {
- EventTypes.RegistPushType("area.weekendStarDungeonPush.onWeekendStarDungeonEnterNumPush", typeof(OnWeekendStarDungeonEnterNumPush));
- EventTypes.RegistPushType("area.weekendStarDungeonPush.onWeekendStarDungeonBossOrderPush", typeof(OnWeekendStarDungeonBossOrderPush));
- EventTypes.RegistPushType("area.weekendStarDungeonPush.onWeekendStarDungeonRankChangePush", typeof(OnWeekendStarDungeonRankChangePush));
- EventTypes.RegistRequestType("area.weekendStarDungeonHandler.weekendStarDungeonEnterNpcRequest", typeof(WeekendStarDungeonEnterNpcRequest), typeof(WeekendStarDungeonEnterNpcResponse));
- EventTypes.RegistRequestType("area.weekendStarDungeonHandler.weekendStarDungeonRecvRequest", typeof(WeekendStarDungeonRecvRequest), typeof(WeekendStarDungeonRecvResponse));
- EventTypes.RegistRequestType("area.weekendStarDungeonHandler.weekendStarDungeonSelectTypeRequest", typeof(WeekendStarDungeonSelectTypeRequest), typeof(WeekendStarDungeonSelectTypeResponse));
- EventTypes.RegistRequestType("area.weekendStarDungeonHandler.weekendStarDungeonRecvListRequest", typeof(WeekendStarDungeonRecvListRequest), typeof(WeekendStarDungeonRecvListResponse));
- }
- public WeekendStarDungeonHandler(PomeloClient socket)
- {
- this._socket = socket;
- }
- public void weekendStarDungeonEnterNpcRequest(Action<PomeloException,WeekendStarDungeonEnterNpcResponse> cb,object option = null)
- {
- var request = new WeekendStarDungeonEnterNpcRequest();
- _socket.request<WeekendStarDungeonEnterNpcResponse>(request, (object msg, out int s2c_code, out string s2c_msg) => {
- var rsp = msg as WeekendStarDungeonEnterNpcResponse;
- s2c_code = rsp.s2c_code;
- s2c_msg = rsp.s2c_msg;
- return s2c_code == 200;
- }, cb, option);
- }
- public void weekendStarDungeonRecvRequest(int s2c_id,Action<PomeloException,WeekendStarDungeonRecvResponse> cb,object option = null)
- {
- var request = new WeekendStarDungeonRecvRequest();
- request.s2c_id= s2c_id;
- _socket.request<WeekendStarDungeonRecvResponse>(request, (object msg, out int s2c_code, out string s2c_msg) => {
- var rsp = msg as WeekendStarDungeonRecvResponse;
- s2c_code = rsp.s2c_code;
- s2c_msg = rsp.s2c_msg;
- return s2c_code == 200;
- }, cb, option);
- }
- public void weekendStarDungeonSelectTypeRequest(Action<PomeloException,WeekendStarDungeonSelectTypeResponse> cb,object option = null)
- {
- var request = new WeekendStarDungeonSelectTypeRequest();
- _socket.request<WeekendStarDungeonSelectTypeResponse>(request, (object msg, out int s2c_code, out string s2c_msg) => {
- var rsp = msg as WeekendStarDungeonSelectTypeResponse;
- s2c_code = rsp.s2c_code;
- s2c_msg = rsp.s2c_msg;
- return s2c_code == 200;
- }, cb, option);
- }
- public void weekendStarDungeonRecvListRequest(Action<PomeloException,WeekendStarDungeonRecvListResponse> cb,object option = null)
- {
- var request = new WeekendStarDungeonRecvListRequest();
- _socket.request<WeekendStarDungeonRecvListResponse>(request, (object msg, out int s2c_code, out string s2c_msg) => {
- var rsp = msg as WeekendStarDungeonRecvListResponse;
- s2c_code = rsp.s2c_code;
- s2c_msg = rsp.s2c_msg;
- return s2c_code == 200;
- }, cb, option);
- }
- public void onWeekendStarDungeonEnterNumPush(Action<OnWeekendStarDungeonEnterNumPush> cb)
- {
- _socket.listen_once<OnWeekendStarDungeonEnterNumPush>(cb);
- }
- public void onWeekendStarDungeonBossOrderPush(Action<OnWeekendStarDungeonBossOrderPush> cb)
- {
- _socket.listen_once<OnWeekendStarDungeonBossOrderPush>(cb);
- }
- public void onWeekendStarDungeonRankChangePush(Action<OnWeekendStarDungeonRankChangePush> cb)
- {
- _socket.listen_once<OnWeekendStarDungeonRankChangePush>(cb);
- }
- }
- }
|