using System; using Base; using Model; namespace Hotfix { [MessageHandler(AppType.Gate)] public class G2G_LockRequestHandler : AMRpcHandler { protected override async void Run(Session session, G2G_LockRequest message, Action reply) { G2G_LockResponse response = new G2G_LockResponse(); try { Unit unit = Game.Scene.GetComponent().Get(message.Id); if (unit == null) { response.Error = ErrorCode.ERR_NotFoundUnit; reply(response); } await unit.GetComponent().Lock(message.Address); reply(response); } catch (Exception e) { ReplyError(response, e, reply); } } } }