using System; using System.Collections.Generic; namespace ET { [ActorMessageHandler] public class C2M_GetPetInfoHandler : AMActorLocationRpcHandler { protected override async ETTask Run(Unit unit, C2M_GetPetInfo request, M2C_GetPetInfo response, Action reply) { Pet pet = unit.GetComponent(); PlayerData data = unit.GetComponent(); response.eatCount = data.petEatCount; response.active = data.petActive; response.petState = (int) pet.petState; response.remainTime = (int) (pet.actionEndTime - TimeHelper.ClientNow()); reply(); await ETTask.CompletedTask; } } }