2021-05-02 23:18:14 +08:00
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
namespace ET
|
|
|
|
|
{
|
|
|
|
|
[ActorMessageHandler]
|
|
|
|
|
public class C2M_PutonStarSoulItemHandler : AMActorLocationRpcHandler<Unit, C2M_PutonStarSoulItem, M2C_PutonStarSoulItem>
|
|
|
|
|
{
|
|
|
|
|
protected override async ETTask Run(Unit unit, C2M_PutonStarSoulItem request, M2C_PutonStarSoulItem response, Action reply)
|
|
|
|
|
{
|
2021-05-03 01:54:31 +08:00
|
|
|
|
if (unit.teamState != TeamState.None)
|
|
|
|
|
{
|
|
|
|
|
response.Message = "战斗中";
|
|
|
|
|
reply();
|
|
|
|
|
return;
|
|
|
|
|
}
|
2021-05-02 23:18:14 +08:00
|
|
|
|
var bag = unit.GetComponent<StarSoulBag>();
|
|
|
|
|
string retStr = bag.PutonItem(request.itemId);
|
|
|
|
|
if (retStr !=null)
|
|
|
|
|
{
|
|
|
|
|
response.Message = retStr;
|
|
|
|
|
}
|
|
|
|
|
reply();
|
|
|
|
|
await ETTask.CompletedTask;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|