Browse Source

修改一个收获的BUG

master
wserver/wangdisen 3 years ago
parent
commit
95ce86a665
  1. 2
      Server/Hotfix/Demo/Construct/Handler/C2M_ConstructFinishHandler.cs
  2. 4
      Server/Hotfix/Demo/Farmland/Handler/C2M_FarmlandHarvestHandler.cs
  3. 4
      Unity/Codes/Hotfix/Demo/Helper/FarmlandHelper.cs
  4. 4
      Unity/Codes/Hotfix/Demo/Unit/UnitSystem.cs

2
Server/Hotfix/Demo/Construct/Handler/C2M_ConstructFinishHandler.cs

@ -10,7 +10,7 @@ namespace ET
var building = ConstructOperate.ConstructFinish(unit, request.ConstructId); var building = ConstructOperate.ConstructFinish(unit, request.ConstructId);
response.Error = ErrorCode.ERR_Success; response.Error = ErrorCode.ERR_Success;
reply(); reply();
ConstructHelper.NofityConstructFinish(unit,request.ConstructId, building.Id); ConstructHelper.NotifyConstructFinish(unit,request.ConstructId, building.Id);
} }
catch (Exception e) catch (Exception e)
{ {

4
Server/Hotfix/Demo/Farmland/Handler/C2M_FarmlandHarvestHandler.cs

@ -10,11 +10,11 @@ namespace ET
{ {
try try
{ {
People people;
Farmland farmland = unit.GetGrandChild<Farmland>(request.FarmlandId); Farmland farmland = unit.GetGrandChild<Farmland>(request.FarmlandId);
if (farmland!=null) if (farmland!=null)
{ {
people = unit.GetComponent<PeopleComponent>().GetChild<People>(request.PeopleId); People people = unit.GetComponent<PeopleComponent>().GetChild<People>(request.PeopleId);
if (people != null) if (people != null)
{ {
response.Error = FarmlandOperate.FinishHarvest(unit, farmland, people); response.Error = FarmlandOperate.FinishHarvest(unit, farmland, people);

4
Unity/Codes/Hotfix/Demo/Helper/FarmlandHelper.cs

@ -109,14 +109,14 @@ namespace ET
public static async ETTask<int> StartFarmlandHarvest(Unit unit, People people, Farmland farmland) public static async ETTask<int> StartFarmlandHarvest(Unit unit, People people, Farmland farmland)
{ {
return await PeopleHelper.ChangeBehave(unit, people, ConstBehaveType.BEHAVE_PREPARE_HARVEST,farmland.Id); return await PeopleHelper.ChangeBehave(unit, people, ConstBehaveType.BEHAVE_HARVEST,farmland.Id);
} }
public static async ETTask<int> FarmlandHarvest(Unit unit, Farmland farmland,People people) public static async ETTask<int> FarmlandHarvest(Unit unit, Farmland farmland,People people)
{ {
try try
{ {
C2M_FarmlandHarvest msg = new C2M_FarmlandHarvest() { FarmlandId = farmland.Id }; C2M_FarmlandHarvest msg = new C2M_FarmlandHarvest() { FarmlandId = farmland.Id };
M2C_FarmlandPlant resp = await unit.ZoneScene().GetComponent<SessionComponent>().Session.Call(msg) as M2C_FarmlandPlant; M2C_FarmlandHarvest resp = await unit.ZoneScene().GetComponent<SessionComponent>().Session.Call(msg) as M2C_FarmlandHarvest;
if (resp.Error == ErrorCode.ERR_Success) if (resp.Error == ErrorCode.ERR_Success)
{ {
FarmlandOperate.FinishHarvest(unit, farmland,people); FarmlandOperate.FinishHarvest(unit, farmland,people);

4
Unity/Codes/Hotfix/Demo/Unit/UnitSystem.cs

@ -252,8 +252,8 @@ namespace ET
} }
} }
#if SERVER #if SERVER
FarmlandHelper.NotifyFarmlandRipe(unit,ripeIds); FarmlandHelper.NotifyFarmlandRipe(self,ripeIds);
FarmlandHelper.M2C_NtfFarmlandRipeProgress(unit,farmlandIds,ripeIds) FarmlandHelper.M2C_NtfFarmlandRipeProgress(self,farmlandIds,progresses);
#endif #endif
} }

Loading…
Cancel
Save