34 lines
1.0 KiB
C#
34 lines
1.0 KiB
C#
|
|
|||
|
using System;
|
|||
|
|
|||
|
namespace ET
|
|||
|
{
|
|||
|
[ActorMessageHandler()]
|
|||
|
public class C2M_HandleTeamHandler : AMActorLocationRpcHandler<Unit, C2M_HandleTeam, M2C_HandleTeam>
|
|||
|
{
|
|||
|
protected override async ETTask Run(Unit unit, C2M_HandleTeam request, M2C_HandleTeam response, Action reply)
|
|||
|
{
|
|||
|
Team team = null;
|
|||
|
if (request.IsRequest)//申请 A申请进入B队 ,此处unit = B
|
|||
|
{
|
|||
|
if (request.HandleInfo.Bool)
|
|||
|
{
|
|||
|
team = TeamComponent.Instance.HandleRequestTeam(unit, request.HandleInfo.Id);
|
|||
|
}
|
|||
|
}
|
|||
|
else//邀请 A邀请B进入A队, 此处unit =B
|
|||
|
{
|
|||
|
if (request.HandleInfo.Bool)
|
|||
|
{
|
|||
|
team = TeamComponent.Instance.HandleIniviteTeam(unit, request.HandleInfo.Id);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
reply();
|
|||
|
if (team != null)
|
|||
|
TeamHelper.SendTeamMember(team);
|
|||
|
|
|||
|
await ETTask.CompletedTask;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|