38 lines
1.2 KiB
C#
38 lines
1.2 KiB
C#
|
using System;
|
|||
|
using System.Net;
|
|||
|
|
|||
|
namespace ET
|
|||
|
{
|
|||
|
[ActorMessageHandler]
|
|||
|
public class C2M_GetCharacterHandler : AMActorLocationRpcHandler<Unit, C2M_GetCharacter, M2C_GetCharacter>
|
|||
|
{
|
|||
|
|
|||
|
protected override async ETTask Run(Unit unit, C2M_GetCharacter request, M2C_GetCharacter response, Action reply)
|
|||
|
{
|
|||
|
try
|
|||
|
{
|
|||
|
Unit unitGet = MapUnitComponent.Instance.Get(request.Id);
|
|||
|
if (!unitGet)
|
|||
|
{
|
|||
|
response.Message = "对方不在线";
|
|||
|
reply();
|
|||
|
return;
|
|||
|
}
|
|||
|
if (request.Id != unit.Id)
|
|||
|
{
|
|||
|
M2C_SyncUnitAttributeList message = CharacterHelper.GetSyncUnitAttributeList(unitGet);
|
|||
|
message.UnitId = request.Id;
|
|||
|
MessageHelper.SendActor(unit, message);
|
|||
|
}
|
|||
|
response.UnitCharacter =await CharacterHelper.GetUnitCharacter(unitGet);
|
|||
|
BagHelper.GetWornEquipInfo(unitGet, response.WornBagMapList);
|
|||
|
}
|
|||
|
catch (Exception e)
|
|||
|
{
|
|||
|
Log.Error(e);
|
|||
|
}
|
|||
|
reply();
|
|||
|
await ETTask.CompletedTask;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|