123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- /*-----------------------------------------------
- *本文件由代码生成器自动生成,
- *千万不要修改本文件的任何代码,
- *修改的的任何代码都会被覆盖掉!
- --------------------------------------------------*/
- using System.IO;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using Pomelo.DotNetClient;
- namespace pomelo.area
- {
- public class FuwaHandler
- {
- private PomeloClient _socket;
- public FuwaExchangeRespone lastFuwaExchangeRespone { get { return _socket.GetLastResponse<FuwaExchangeRespone>(); } }
- public FuwaGameInfoRespone lastFuwaGameInfoRespone { get { return _socket.GetLastResponse<FuwaGameInfoRespone>(); } }
- public FuwaGameRespone lastFuwaGameRespone { get { return _socket.GetLastResponse<FuwaGameRespone>(); } }
- public FuwaRewardExchangeInfoRespone lastFuwaRewardExchangeInfoRespone { get { return _socket.GetLastResponse<FuwaRewardExchangeInfoRespone>(); } }
- public FuwaRewardExchangeRespone lastFuwaRewardExchangeRespone { get { return _socket.GetLastResponse<FuwaRewardExchangeRespone>(); } }
- static FuwaHandler()
- {
- EventTypes.RegistPushType("area.fuwaPush.fuwaFindPush", typeof(FuwaFindPush));
- EventTypes.RegistRequestType("area.fuwaHandler.fuwaExchangeRequest", typeof(FuwaExchangeRequest), typeof(FuwaExchangeRespone));
- EventTypes.RegistRequestType("area.fuwaHandler.fuwaGameInfoRequest", typeof(FuwaGameInfoRequest), typeof(FuwaGameInfoRespone));
- EventTypes.RegistRequestType("area.fuwaHandler.fuwaGameRequest", typeof(FuwaGameRequest), typeof(FuwaGameRespone));
- EventTypes.RegistRequestType("area.fuwaHandler.fuwaRewardExchangeInfoRequest", typeof(FuwaRewardExchangeInfoRequest), typeof(FuwaRewardExchangeInfoRespone));
- EventTypes.RegistRequestType("area.fuwaHandler.fuwaRewardExchangeRequest", typeof(FuwaRewardExchangeRequest), typeof(FuwaRewardExchangeRespone));
- }
- public FuwaHandler(PomeloClient socket)
- {
- this._socket = socket;
- }
- public void fuwaExchangeRequest(string code,int count,Action<PomeloException,FuwaExchangeRespone> cb,object option = null)
- {
- var request = new FuwaExchangeRequest();
- request.code= code;
- request.count= count;
- _socket.request<FuwaExchangeRespone>(request, (object msg, out int s2c_code, out string s2c_msg) => {
- var rsp = msg as FuwaExchangeRespone;
- s2c_code = rsp.s2c_code;
- s2c_msg = rsp.s2c_msg;
- return s2c_code == 200;
- }, cb, option);
- }
- public void fuwaGameInfoRequest(Action<PomeloException,FuwaGameInfoRespone> cb,object option = null)
- {
- var request = new FuwaGameInfoRequest();
- _socket.request<FuwaGameInfoRespone>(request, (object msg, out int s2c_code, out string s2c_msg) => {
- var rsp = msg as FuwaGameInfoRespone;
- s2c_code = rsp.s2c_code;
- s2c_msg = rsp.s2c_msg;
- return s2c_code == 200;
- }, cb, option);
- }
- public void fuwaGameRequest(int index,int bet_index,Action<PomeloException,FuwaGameRespone> cb,object option = null)
- {
- var request = new FuwaGameRequest();
- request.index= index;
- request.bet_index= bet_index;
- _socket.request<FuwaGameRespone>(request, (object msg, out int s2c_code, out string s2c_msg) => {
- var rsp = msg as FuwaGameRespone;
- s2c_code = rsp.s2c_code;
- s2c_msg = rsp.s2c_msg;
- return s2c_code == 200;
- }, cb, option);
- }
- public void fuwaRewardExchangeInfoRequest(Action<PomeloException,FuwaRewardExchangeInfoRespone> cb,object option = null)
- {
- var request = new FuwaRewardExchangeInfoRequest();
- _socket.request<FuwaRewardExchangeInfoRespone>(request, (object msg, out int s2c_code, out string s2c_msg) => {
- var rsp = msg as FuwaRewardExchangeInfoRespone;
- s2c_code = rsp.s2c_code;
- s2c_msg = rsp.s2c_msg;
- return s2c_code == 200;
- }, cb, option);
- }
- public void fuwaRewardExchangeRequest(int index,Action<PomeloException,FuwaRewardExchangeRespone> cb,object option = null)
- {
- var request = new FuwaRewardExchangeRequest();
- request.index= index;
- _socket.request<FuwaRewardExchangeRespone>(request, (object msg, out int s2c_code, out string s2c_msg) => {
- var rsp = msg as FuwaRewardExchangeRespone;
- s2c_code = rsp.s2c_code;
- s2c_msg = rsp.s2c_msg;
- return s2c_code == 200;
- }, cb, option);
- }
- public void onFuwaFindPush(Action<FuwaFindPush> cb)
- {
- _socket.listen_once<FuwaFindPush>(cb);
- }
- }
- }
|