12345678910111213141516171819202122 |
- using System;
- namespace ET.Server
- {
- /// <summary>
- /// 心跳消息
- /// </summary>
- [MessageHandler(SceneType.Game)]
- public class C2G_PingHandler : AMRpcHandler<C2G_Ping, G2C_Ping>
- {
- protected override async ETTask Run(Session session, C2G_Ping request, G2C_Ping response, Action reply)
- {
- if (session.GetComponent<HeartBeatComponent>() != null)
- {
- session.GetComponent<HeartBeatComponent>().CurrentTime = TimeHelper.ClientNowSeconds();
- }
- response.Time = TimeHelper.ServerNow();
- reply();
- await ETTask.CompletedTask;
- }
- }
- }
|