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.
 
 
 
 
 
 

33 lines
956 B

using System;
namespace ET
{
public class C2M_UseSaplingItemHandler : AMActorLocationRpcHandler<Unit, C2M_UseSaplingItem, M2C_UseSaplingItem>
{
protected override async ETTask Run(Unit unit, C2M_UseSaplingItem request, M2C_UseSaplingItem response, Action reply)
{
try
{
var res = StoreOperate.UseSaplingItem(unit, request.ItemId, request.X, request.Y);
if (res == null)
{
response.Error= ErrorCode.ERR_UseError;
}
else
{
response.Error = ErrorCode.ERR_Success;
}
reply();
}
catch (Exception e)
{
response.Message = e.ToString();
response.Error = ErrorCode.ERR_UseError;
reply();
}
await ETTask.CompletedTask;
}
}
}