diff --git a/Server/Hotfix/Game/Helper/UnitHelper.cs b/Server/Hotfix/Game/Helper/UnitHelper.cs index a77cf7f9..2239cf3b 100755 --- a/Server/Hotfix/Game/Helper/UnitHelper.cs +++ b/Server/Hotfix/Game/Helper/UnitHelper.cs @@ -15,28 +15,38 @@ namespace ET { Unit unit = EntityFactory.CreateWithId(domain, id); PlayerData data = await DBComponent.Instance.Query(id); - unit.AddComponent(data); + if (data) + unit.AddComponent(data); Character character = await DBComponent.Instance.Query(id); - unit.AddComponent(character); + if (character) + unit.AddComponent(character); NumericComponent num = await DBComponent.Instance.Query(id); - unit.AddComponent(num); + if (num) + unit.AddComponent(num); UnitSkillComponent unitSkill = await DBComponent.Instance.Query(id); - unit.AddComponent(unitSkill); + if (unitSkill) + unit.AddComponent(unitSkill); //!玩家设置 UserSetting setting = await DBComponent.Instance.Query(id); - unit.AddComponent(setting); + if (setting) + unit.AddComponent(setting); //!任务 UnitTask unitTask = await DBComponent.Instance.Query(id); - unit.AddComponent(unitTask); + if (unitTask) + unit.AddComponent(unitTask); //!背包 Bag bag = await DBComponent.Instance.Query(id); - unit.AddComponent(bag); + if (bag) + unit.AddComponent(bag); UnitScene unitScene = await DBComponent.Instance.Query(id); - unit.AddComponent(unitScene); + if (unitScene) + unit.AddComponent(unitScene); StarSoulBag starSoulBag = await DBComponent.Instance.Query(id); - unit.AddComponent(starSoulBag); + if (starSoulBag) + unit.AddComponent(starSoulBag); Pet pet = await DBComponent.Instance.Query(id); - unit.AddComponent(pet); + if (pet) + unit.AddComponent(pet); unit.AddComponent(); return unit; @@ -96,7 +106,8 @@ namespace ET long mapInstanceId = StartSceneConfigCategory.Instance.GetBySceneName(zone, SceneType.UserCache.ToString()).SceneId; MessageHelper.SendActor(mapInstanceId, new M2U_WriteComponent() { Id = t.Id, type = typeof (T).Name, component = t }); } - public static void SaveComponenet(int zone,T t) where T : Entity + + public static void SaveComponenet(int zone, T t) where T : Entity { if (zone == 0) { @@ -129,7 +140,7 @@ namespace ET unitInfo.YAngle = unitScene.YAngle; } - public static async ETTask AddComponentFromDB(Unit unit,int jobId) + public static async ETTask AddComponentFromDB(Unit unit, int jobId) { int zone = unit.DomainZone(); long id = unit.Id; @@ -150,7 +161,7 @@ namespace ET character = unit.AddComponent(); else unit.AddComponent(character); - + var num = await UnitHelper.Query(zone, id); if (num == null) { @@ -231,8 +242,9 @@ namespace ET { bag.InitBag(); } + bag.CheckSlot(); - + Store store = await StoreComponent.Instance.Query(unit.Id); //!初始化仓库 if (store == null) @@ -250,9 +262,8 @@ namespace ET public static async ETTask SendUnitInfo(Unit unit) { - Log.Debug($"【{ UserComponent.Instance.Get(unit.Id)?.NickName} ({ unit.Id})】已经进入游戏"); + Log.Debug($"【{UserComponent.Instance.Get(unit.Id)?.NickName} ({unit.Id})】已经进入游戏"); PlayerData data = unit.GetComponent(); - var num = unit.GetComponent(); CharacterHelper.ResetAddNumeric(unit, num); @@ -263,19 +274,16 @@ namespace ET Log.Error($"unitScene == null where id = {unit.Id}"); return; } - if(unitScene.MapId/100 == Sys_SceneId.Scene_BattleIdle) + + if (unitScene.MapId / 100 == Sys_SceneId.Scene_BattleIdle) { unitScene.MapId = Sys_SceneId.Scene_MainCity * 100 + 1; } - + //!+任务相关 - //!+发送Boss消息 Game.EventSystem.Publish(new EventType.AfterEnterGame() { unit = unit }); - - } - } } \ No newline at end of file diff --git a/Tools/ExcelTool/Excel/MaintainRewardConfig.xlsx b/Tools/ExcelTool/Excel/MaintainRewardConfig.xlsx index 99973327..b01ed746 100755 Binary files a/Tools/ExcelTool/Excel/MaintainRewardConfig.xlsx and b/Tools/ExcelTool/Excel/MaintainRewardConfig.xlsx differ diff --git a/Unity/Assets/Download/DataTable/MaintainRewardConfig.json b/Unity/Assets/Download/DataTable/MaintainRewardConfig.json index 5a1a3182..64e2074f 100644 --- a/Unity/Assets/Download/DataTable/MaintainRewardConfig.json +++ b/Unity/Assets/Download/DataTable/MaintainRewardConfig.json @@ -1 +1 @@ -eNolTT0LwjAU3AP5D3Krb3gJQunbpC4OXRwECaEUWkuWBGLEQfrfTe1wcMd9Oa2cYTZ0+GIIE+Qv8IBYtpX0kJZwgTSE+5xfIcWaIdzmz5inc84QV5sFgn4MsVTsVpfiMyzHXYAwXLdxw5ZPhC69Y9kueCW/etLKa/UDI1Imdg== \ No newline at end of file +eNqL5uWKNjQwMNRRqFaKz0xRsgJzlCKVrIwMjIAMXyUrSx0lFyAXyAlLLSrOzM8DKtJR8ssvyUxOVbJSerJj7fPl3S+6mp7uX/1k54T3exqVdJSCUssTi1Ici4qUrKKBBpcA1fkmZuaVADFEyjk/Ly0zXRvCAWqI9wTZbWhgZGCio+ScX5pXAnKBgUGtTmxtrA4vVywvFwA4dDcg \ No newline at end of file