C2G_PingHandler.cs 474 B

1234567891011121314151617181920
  1. using System;
  2. namespace ET.Server
  3. {
  4. /// <summary>
  5. /// 心跳消息
  6. /// </summary>
  7. [MessageHandler(SceneType.Game)]
  8. public class C2G_PingHandler : AMRpcHandler<C2G_Ping, G2C_Ping>
  9. {
  10. protected override async ETTask Run(Session session, C2G_Ping request, G2C_Ping response, Action reply)
  11. {
  12. session.LastPingTime = TimeHelper.ClientNow();
  13. response.Time = TimeHelper.ServerNow();
  14. reply();
  15. await ETTask.CompletedTask;
  16. }
  17. }
  18. }