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.
36 lines
1.0 KiB
36 lines
1.0 KiB
3 years ago
|
using System;
|
||
|
|
||
|
namespace ET
|
||
|
{
|
||
|
|
||
|
|
||
|
public class C2M_CabinUpdateFarmlandsHandler: AMActorLocationRpcHandler<Unit, C2M_CabinUpdateFarmlands, M2C_CabinUpdateFarmlands>
|
||
|
{
|
||
|
protected async override ETTask Run(Unit unit, C2M_CabinUpdateFarmlands request, M2C_CabinUpdateFarmlands response, Action reply)
|
||
|
{
|
||
|
try
|
||
|
{
|
||
|
var cabin = unit.GetGrandChild<Cabin>(request.CabinId);
|
||
|
if (cabin == null)
|
||
|
{
|
||
|
response.Error = ErrorCode.ERR_CabinNotFound;
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
CabinOperate.CabinUpdateFarmlands(unit,cabin,request.FarmlandIds);
|
||
|
response.Error = ErrorCode.ERR_Success;
|
||
|
}
|
||
|
|
||
|
reply();
|
||
|
}
|
||
|
catch (Exception e)
|
||
|
{
|
||
|
response.Message = e.ToString();
|
||
|
response.Error = ErrorCode.ERR_OperateFail;
|
||
|
reply();
|
||
|
}
|
||
|
|
||
|
await ETTask.CompletedTask;
|
||
|
}
|
||
|
}
|
||
|
}
|