zxl
/
CTT
forked from Cal/CTT
1
0
Fork 0
CTT/Server/Hotfix/Game/Handler/Map/C2M_BackMainCityHandler.cs

28 lines
796 B
C#
Raw Normal View History

2021-04-08 20:09:59 +08:00
using System;
namespace ET
{
[ActorMessageHandler]
public class C2M_BackMainCityHandler : AMActorLocationRpcHandler<Unit, C2M_BackMainCity, M2C_BackMainCity>
{
protected override async ETTask Run(Unit unit, C2M_BackMainCity request, M2C_BackMainCity response, Action reply)
{
if (!unit.IsTeamLeader)
{
response.Message = "你不是队长!";
reply();
return;
}
if (unit.GetComponent<PlayerData>().IsBattleIdle)
{
response.Message = "挂机中!";
reply();
return;
}
await Game.EventSystem.Publish(new EventType.BackMainCity { unit = unit });
reply();
}
}
}