using System; using Base; using Model; namespace Hotfix { [MessageHandler(AppType.Gate)] public class G2G_LockReleaseRequestHandler : AMRpcHandler { protected override void Run(Session session, G2G_LockReleaseRequest message, Action reply) { G2G_LockReleaseResponse g2GLockReleaseResponse = new G2G_LockReleaseResponse(); try { Unit unit = Game.Scene.GetComponent().Get(message.Id); if (unit == null) { g2GLockReleaseResponse.Error = ErrorCode.ERR_NotFoundUnit; reply(g2GLockReleaseResponse); return; } unit.GetComponent().Release(message.Address); reply(g2GLockReleaseResponse); } catch (Exception e) { ReplyError(g2GLockReleaseResponse, e, reply); } } } }