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.
28 lines
886 B
28 lines
886 B
using System; |
|
|
|
namespace ET |
|
{ |
|
public class C2M_RemoveBuildingHandler : AMActorLocationRpcHandler<Unit, C2M_RemoveBuilding, M2C_RemoveBuilding> |
|
{ |
|
protected async override ETTask Run(Unit unit, C2M_RemoveBuilding request, M2C_RemoveBuilding response, Action reply) |
|
{ |
|
try |
|
{ |
|
BuildingComponent buildingComponent = unit.GetComponent<BuildingComponent>(); |
|
buildingComponent.RemoveChildWithId(request.Id); |
|
|
|
response.Error = ErrorCode.ERR_Success; |
|
response.Id = request.Id; |
|
reply(); |
|
} |
|
catch (Exception e) |
|
{ |
|
response.Message = e.ToString(); |
|
response.Error = ErrorCode.ERR_BuildError; |
|
reply(); |
|
} |
|
|
|
await ETTask.CompletedTask; |
|
} |
|
} |
|
} |