using System; namespace ET { public class C2M_ExitBattleHandler: AMActorLocationRpcHandler { protected async override ETTask Run(Unit unit, C2M_ExitBattle request, M2C_ExitBattle response, Action reply) { try { var res = unit.ExitBattle(); if (res == false) { response.Error = ErrorCode.ERR_CanNotFoundBattle; reply(); return; } response.Error = ErrorCode.ERR_Success; reply(); } catch (Exception e) { response.Message = e.ToString(); response.Error = ErrorCode.ERR_BuildError; reply(); } await ETTask.CompletedTask; } } }