using Fantasy; using Fantasy.Async; using Fantasy.Network.Interface; namespace NB.Map; public class C2Map_EnterMapRequestHandler : RouteRPC { protected override async FTask Run(MapUnit entity, C2Map_EnterMapRequest request, Map2C_EnterMapResponse response, Action reply) { var roomManageComponent = entity.Scene.GetComponent(); if (roomManageComponent == null) { response.ErrorCode = ErrorCode.ErrServer; return; } response.ErrorCode = await entity.EnterMap(request.MapId); } }