CTT/Server/Hotfix/Game/Handler/Team/C2M_HandleTeamHandler.cs

50 lines
1.7 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

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)
{
// if (AppConfig.inst.isTest)
// {
// Log.Info($"{unit.Id} {request.HandleInfo.Id} {request.IsRequest}");
// foreach (var kv in TeamComponent.Instance.teamDic)
// {
// Log.Info($"{kv.Key}:{kv.Value.GetMemberName()}");
// }
// }
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);
}
}
// if (AppConfig.inst.isTest)
// {
// Log.Info($"{unit.Id} {request.HandleInfo.Id} {request.IsRequest}");
// foreach (var kv in TeamComponent.Instance.teamDic)
// {
// Log.Info($"{kv.Key}:{kv.Value.GetMemberName()}");
// }
// }
reply();
if (team != null)
TeamHelper.SendTeamMember(team);
await ETTask.CompletedTask;
}
}
}