diff --git a/Server/Hotfix/Demo/People/Handler/C2M_ChangeBehaveHandler.cs b/Server/Hotfix/Demo/People/Handler/C2M_ChangeBehaveHandler.cs new file mode 100644 index 0000000..09e0db7 --- /dev/null +++ b/Server/Hotfix/Demo/People/Handler/C2M_ChangeBehaveHandler.cs @@ -0,0 +1,36 @@ +using System; + +namespace ET +{ + + public class C2M_ChangeBehaveHandler: AMActorLocationRpcHandler + { + protected async override ETTask Run(Unit unit, C2M_ChangeBehave request, M2C_ChangeBehave response, Action reply) + { + try + { + People people = unit.GetComponent().GetChild(request.PeopleId); + if (people != null) + { + PeopleOperate.ChangeBehave(unit, people, request.BehaveType, request.TargetId); + response.Error = ErrorCode.ERR_Success; + } + else + { + response.Error = ErrorCode.ERR_PeopleMoveFail; + } + reply(); + + } + catch (Exception e) + { + response.Message = e.ToString(); + response.Error = ErrorCode.ERR_PeopleMoveFail; + reply(); + } + + await ETTask.CompletedTask; + + } + } +} \ No newline at end of file diff --git a/Unity/Codes/Hotfix/Demo/Operate/FarmlandOperate.cs b/Unity/Codes/Hotfix/Demo/Operate/FarmlandOperate.cs index c44db83..53862e6 100644 --- a/Unity/Codes/Hotfix/Demo/Operate/FarmlandOperate.cs +++ b/Unity/Codes/Hotfix/Demo/Operate/FarmlandOperate.cs @@ -83,8 +83,8 @@ namespace ET var sc = unit.GetComponent(); if (sc.Remove(cropCfg.SeedNeed, cropCfg.SeedNum)) { - farmland.Seed(cropCfg.SeedNeed); - sucCropList.Add(cropCfg.SeedNeed); + farmland.Seed(cropCfg.Id); + sucCropList.Add(cropCfg.Id); sucFarmlandList.Add(farmlandIds[i]); } }