UndergroundPlaceHandler.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*-----------------------------------------------
  2. *本文件由代码生成器自动生成,
  3. *千万不要修改本文件的任何代码,
  4. *修改的的任何代码都会被覆盖掉!
  5. --------------------------------------------------*/
  6. using System.IO;
  7. using System;
  8. using System.Collections.Generic;
  9. using System.Linq;
  10. using System.Text;
  11. using Pomelo.DotNetClient;
  12. namespace pomelo.area
  13. {
  14. public class UndergroundPlaceHandler
  15. {
  16. private PomeloClient _socket;
  17. public BossRefrushTimeResponse lastBossRefrushTimeResponse { get { return _socket.GetLastResponse<BossRefrushTimeResponse>(); } }
  18. static UndergroundPlaceHandler()
  19. {
  20. EventTypes.RegistPushType("area.undergroundPlacePush.bossRefrushTimePush", typeof(BossRefrushTimePush));
  21. EventTypes.RegistRequestType("area.undergroundPlaceHandler.bossRefrushTimeRequest", typeof(BossRefrushTimeRequest), typeof(BossRefrushTimeResponse));
  22. }
  23. public UndergroundPlaceHandler(PomeloClient socket)
  24. {
  25. this._socket = socket;
  26. }
  27. public void bossRefrushTimeRequest(int mapID,Action<PomeloException,BossRefrushTimeResponse> cb,object option = null)
  28. {
  29. var request = new BossRefrushTimeRequest();
  30. request.mapID= mapID;
  31. _socket.request<BossRefrushTimeResponse>(request, (object msg, out int s2c_code, out string s2c_msg) => {
  32. var rsp = msg as BossRefrushTimeResponse;
  33. s2c_code = rsp.s2c_code;
  34. s2c_msg = rsp.s2c_msg;
  35. return s2c_code == 200;
  36. }, cb, option);
  37. }
  38. public void onBossRefrushTimePush(Action<BossRefrushTimePush> cb)
  39. {
  40. _socket.listen_once<BossRefrushTimePush>(cb);
  41. }
  42. }
  43. }