|
|
|
@ -28,15 +28,16 @@ namespace ET
|
|
|
|
|
throw; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
public static async ETTask<int> FarmlandPlant(Unit unit, long farmlandId) |
|
|
|
|
|
|
|
|
|
public static async ETTask<int> FarmlandPlant(Unit unit, Farmland farmland,People people) |
|
|
|
|
{ |
|
|
|
|
try |
|
|
|
|
{ |
|
|
|
|
C2M_FarmlandPlant msg = new C2M_FarmlandPlant() { FarmlandId = farmlandId}; |
|
|
|
|
C2M_FarmlandPlant msg = new C2M_FarmlandPlant() { FarmlandId = farmland.Id,PeopleId = people.Id}; |
|
|
|
|
M2C_FarmlandPlant resp = await unit.ZoneScene().GetComponent<SessionComponent>().Session.Call(msg) as M2C_FarmlandPlant; |
|
|
|
|
if (resp.Error == ErrorCode.ERR_Success) |
|
|
|
|
{ |
|
|
|
|
FarmlandOperate.Plant(unit, farmlandId); |
|
|
|
|
FarmlandOperate.Plant(unit, farmland,people); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
@ -52,15 +53,15 @@ namespace ET
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static async ETTask<int> FarmlandHarvest(Unit unit, long farmlandId) |
|
|
|
|
public static async ETTask<int> FarmlandHarvest(Unit unit, Farmland farmland,People people) |
|
|
|
|
{ |
|
|
|
|
try |
|
|
|
|
{ |
|
|
|
|
C2M_FarmlandHarvest msg = new C2M_FarmlandHarvest() { FarmlandId = farmlandId }; |
|
|
|
|
C2M_FarmlandHarvest msg = new C2M_FarmlandHarvest() { FarmlandId = farmland.Id }; |
|
|
|
|
M2C_FarmlandPlant resp = await unit.ZoneScene().GetComponent<SessionComponent>().Session.Call(msg) as M2C_FarmlandPlant; |
|
|
|
|
if (resp.Error == ErrorCode.ERR_Success) |
|
|
|
|
{ |
|
|
|
|
FarmlandOperate.Harvest(unit, farmlandId); |
|
|
|
|
FarmlandOperate.Harvest(unit, farmland,people); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
@ -76,14 +77,14 @@ namespace ET
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static async ETTask<int> FarmlandPlantFinish(Unit unit,long peopleId) |
|
|
|
|
public static async ETTask<int> FarmlandPlantFinish(Unit unit,People people) |
|
|
|
|
{ |
|
|
|
|
return await PeopleHelper.ChangeBehave(unit, peopleId, 0, ConstBehaveType.BEHAVE_IDLE); |
|
|
|
|
return await PeopleHelper.ChangeBehave(unit, people, 0, ConstBehaveType.BEHAVE_IDLE); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static async ETTask<int> FarmlandHarvestFinish(Unit unit,long peopleId) |
|
|
|
|
public static async ETTask<int> FarmlandHarvestFinish(Unit unit,People people) |
|
|
|
|
{ |
|
|
|
|
return await PeopleHelper.ChangeBehave(unit, peopleId, 0, ConstBehaveType.BEHAVE_IDLE); |
|
|
|
|
return await PeopleHelper.ChangeBehave(unit, people, 0, ConstBehaveType.BEHAVE_IDLE); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|