ModuleAttendance.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using pomelo.connector;
  7. using CommonLang.Property;
  8. using pomelo.area;
  9. namespace XmdsBotTest.Runner
  10. {
  11. public class ModuleAttendance : BotRunner.RunnerModule
  12. {
  13. public ModuleAttendance(BotRunner r) : base(r)
  14. {
  15. }
  16. protected internal override void OnGateBindPlayer(BindPlayerResponse e)
  17. {
  18. base.OnGateBindPlayer(e);
  19. }
  20. protected internal override void OnBattleActorReady(CommonAI.ZoneClient.ZoneLayer layer, CommonAI.ZoneClient.ZoneActor actor)
  21. {
  22. layer.AddTimeDelayMS(Config.CheckIntervalMS, (t) =>
  23. {
  24. if (Enable)
  25. {
  26. }
  27. });
  28. layer.AddTimePeriodicMS(Config.CheckIntervalMS, (t) =>
  29. {
  30. if (Enable)
  31. {
  32. try_get_attendance_info();
  33. }
  34. });
  35. }
  36. private void try_get_attendance_info()
  37. {
  38. client.GameSocket.attendanceHandler.getAttendanceInfoRequest(
  39. (err, rsp) =>
  40. { });
  41. }
  42. [Desc("签到配置")]
  43. [Expandable]
  44. public class Config
  45. {
  46. [Desc("签到检测间隔")]
  47. public static int CheckIntervalMS = 5000;
  48. public override string ToString()
  49. {
  50. return "签到配置";
  51. }
  52. }
  53. }
  54. }