You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
889 B
31 lines
889 B
3 years ago
|
using System;
|
||
|
|
||
|
namespace ET
|
||
|
{
|
||
|
public class C2M_ExitBattleHandler: AMActorLocationRpcHandler<Unit, C2M_ExitBattle, M2C_ExitBattle>
|
||
|
{
|
||
|
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;
|
||
|
}
|
||
|
}
|
||
|
}
|