From 59b7100cf894a1e0028e4f370e83e8c81db68404 Mon Sep 17 00:00:00 2001 From: Gabriel Slomka Date: Sun, 12 May 2024 21:46:50 +0100 Subject: [PATCH] Fixes --- .../Addressables/Prefabs/Buildings/dungeon.prefab | 14 +++++++++++--- .../Assets/Code/Editor/AddressableGeneration.cs | 4 ++-- .../Harvesting/HarvestingPredictionComponent.cs | 6 +++--- .../Party/UI/WidgetPartyButtonTracking.cs | 6 +++--- .../Code/Runtime/UnityServices/Input/GameInputs.cs | 4 ++-- .../Code/Runtime/UnityServices/UI/GameHUD.cs | 7 ++++--- .../NoShadow/NoShadow.unitypackage.meta | 7 ------- .../Shadow/Shadow.unitypackage.meta | 7 ------- .../NoShadow/NoShadow.unitypackage.meta | 7 ------- .../Shadow/Shadow.unitypackage.meta | 7 ------- .../PictoIcons_(x2).unitypackage.meta | 7 ------- .../LisergyClient/Assets/Plugins/ClientSDK.dll | 2 +- .../LisergyClient/Assets/Plugins/Game.dll | 2 +- .../LisergyClient/Assets/Plugins/GameData.dll | 2 +- .../ProjectSettings/ProjectVersion.txt | 4 ++-- LisergyServer/ClientSDK/ClientSDK.csproj | 3 ++- LisergyServer/Core/BaseServer.csproj | 2 +- .../Engine/DataTypes}/EventPool.cs | 0 .../Engine/DataTypes}/FastNew.cs | 0 LisergyServer/Game/Engine/ECS/ComponentPointers.cs | 2 +- LisergyServer/Game/Game.csproj | 2 +- LisergyServer/RedisMagic/SDL.csproj | 6 +++++- .../StandaloneServer/StandaloneServer.csproj | 2 +- 23 files changed, 41 insertions(+), 62 deletions(-) delete mode 100644 LisergyClient/LisergyClient/Assets/Packs/UiArt/Sprites/Component/Icon_EquipmentIcons_(x2)/NoShadow/NoShadow.unitypackage.meta delete mode 100644 LisergyClient/LisergyClient/Assets/Packs/UiArt/Sprites/Component/Icon_EquipmentIcons_(x2)/Shadow/Shadow.unitypackage.meta delete mode 100644 LisergyClient/LisergyClient/Assets/Packs/UiArt/Sprites/Component/Icon_ItemIcons_(x2)/NoShadow/NoShadow.unitypackage.meta delete mode 100644 LisergyClient/LisergyClient/Assets/Packs/UiArt/Sprites/Component/Icon_ItemIcons_(x2)/Shadow/Shadow.unitypackage.meta delete mode 100644 LisergyClient/LisergyClient/Assets/Packs/UiArt/Sprites/Component/Icon_PictoIcons_(x2)/PictoIcons_(x2).unitypackage.meta rename LisergyServer/{RedisMagic => Game/Engine/DataTypes}/EventPool.cs (100%) rename LisergyServer/{RedisMagic => Game/Engine/DataTypes}/FastNew.cs (100%) diff --git a/LisergyClient/LisergyClient/Assets/Addressables/Prefabs/Buildings/dungeon.prefab b/LisergyClient/LisergyClient/Assets/Addressables/Prefabs/Buildings/dungeon.prefab index 61e81fb2a..686589061 100644 --- a/LisergyClient/LisergyClient/Assets/Addressables/Prefabs/Buildings/dungeon.prefab +++ b/LisergyClient/LisergyClient/Assets/Addressables/Prefabs/Buildings/dungeon.prefab @@ -646,7 +646,8 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} - m_RemovedComponents: [] + m_RemovedComponents: + - {fileID: 64639328806808446, guid: b95000970818cae4983912b03d9ea1e2, type: 3} m_RemovedGameObjects: [] m_AddedGameObjects: [] m_AddedComponents: [] @@ -731,7 +732,8 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} - m_RemovedComponents: [] + m_RemovedComponents: + - {fileID: 64225151163701754, guid: 4ea2c25a7dabbf04c9e40bc05a5c78da, type: 3} m_RemovedGameObjects: [] m_AddedGameObjects: [] m_AddedComponents: [] @@ -816,7 +818,13 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} - m_RemovedComponents: [] + - target: {fileID: 65221542250991290, guid: d9dd031618d649541a5fadd4c573e31c, + type: 3} + propertyPath: m_Enabled + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: + - {fileID: 65221542250991290, guid: d9dd031618d649541a5fadd4c573e31c, type: 3} m_RemovedGameObjects: [] m_AddedGameObjects: [] m_AddedComponents: [] diff --git a/LisergyClient/LisergyClient/Assets/Code/Editor/AddressableGeneration.cs b/LisergyClient/LisergyClient/Assets/Code/Editor/AddressableGeneration.cs index 57197c368..5d31e1c4c 100644 --- a/LisergyClient/LisergyClient/Assets/Code/Editor/AddressableGeneration.cs +++ b/LisergyClient/LisergyClient/Assets/Code/Editor/AddressableGeneration.cs @@ -2,7 +2,7 @@ using System.IO; using System.Text; using System.Text.RegularExpressions; -using Game.DataTypes; +using Game.Engine.DataTypes; using UnityEditor; using UnityEditor.AddressableAssets; using UnityEditor.AddressableAssets.Settings; @@ -12,7 +12,7 @@ namespace Code.Editor public class AddressableGeneration { // Path Contains -> Enum Name - private static readonly Dictionary CONFIG = new Dictionary() + private static readonly Dictionary CONFIG = new () { {"Sfx", "SoundFX"}, {"Tiles", "TilePrefab"}, diff --git a/LisergyClient/LisergyClient/Assets/Code/Runtime/ClientSystems/Harvesting/HarvestingPredictionComponent.cs b/LisergyClient/LisergyClient/Assets/Code/Runtime/ClientSystems/Harvesting/HarvestingPredictionComponent.cs index 38c99580a..fbf723738 100644 --- a/LisergyClient/LisergyClient/Assets/Code/Runtime/ClientSystems/Harvesting/HarvestingPredictionComponent.cs +++ b/LisergyClient/LisergyClient/Assets/Code/Runtime/ClientSystems/Harvesting/HarvestingPredictionComponent.cs @@ -60,14 +60,14 @@ private void NotifyFinished() private async UniTaskVoid TrackerTask() { var harvestState = _entity.EntityLogic.Harvesting.CalculateCurrentState(); - var nextHarvest = harvestState.TaskState.StartTime + _harvestSpec.HarvestTimePerUnit; + var nextHarvest = harvestState.TimeSnapshot.TimeBlock.StartTime + _harvestSpec.HarvestTimePerUnit; _harvestedTotal = 0; if (nextHarvest < _client.Game.GameTime) { - _harvestedTotal = (ushort)Math.Floor((_client.Game.GameTime - harvestState.TaskState.StartTime) / _harvestSpec.HarvestTimePerUnit); + _harvestedTotal = (ushort)Math.Floor((_client.Game.GameTime - harvestState.TimeSnapshot.TimeBlock.StartTime) / _harvestSpec.HarvestTimePerUnit); if (_harvestedTotal > _initialComponent.Resource.Amount) _harvestedTotal = _initialComponent.Resource.Amount; - nextHarvest = harvestState.TaskState.StartTime + (_harvestSpec.HarvestTimePerUnit * (_harvestedTotal + 1)); + nextHarvest = harvestState.TimeSnapshot.TimeBlock.StartTime + (_harvestSpec.HarvestTimePerUnit * (_harvestedTotal + 1)); _client.Game.Log.Debug($"[Harvest Prediction] Was harvesting already for some time - Harvested Total Start {_harvestedTotal}"); } var depleted = _harvestedTotal >= _initialComponent.Resource.Amount; diff --git a/LisergyClient/LisergyClient/Assets/Code/Runtime/ClientSystems/Party/UI/WidgetPartyButtonTracking.cs b/LisergyClient/LisergyClient/Assets/Code/Runtime/ClientSystems/Party/UI/WidgetPartyButtonTracking.cs index 509d466bf..825b900cd 100644 --- a/LisergyClient/LisergyClient/Assets/Code/Runtime/ClientSystems/Party/UI/WidgetPartyButtonTracking.cs +++ b/LisergyClient/LisergyClient/Assets/Code/Runtime/ClientSystems/Party/UI/WidgetPartyButtonTracking.cs @@ -178,12 +178,12 @@ public void UpdateResourceTask(HarvestingUpdateEvent ev) _taskIcon.SetBackground(resourceSpec.Art); _taskNumber.text = ev.AmountHarvestedTotal.ToString(); - var totalTime = _client.Game.GameTime - ev.InitialState.TaskState.StartTime; - var pct = totalTime.TotalMilliseconds / ev.InitialState.TaskState.TotalTimeRequiredForTask.TotalMilliseconds; + var totalTime = _client.Game.GameTime - ev.InitialState.TimeSnapshot.TimeBlock.StartTime; + var pct = totalTime.TotalMilliseconds / ev.InitialState.TimeSnapshot.TimeBlock.TotalBlockTime.TotalMilliseconds; if (pct < 1) { ShowBar(); - UpdateBar(ev.InitialState.TaskState.StartTime, ev.InitialState.TaskState.EndTime); + UpdateBar(ev.InitialState.TimeSnapshot.TimeBlock.StartTime, ev.InitialState.TimeSnapshot.TimeBlock.EndTime); } } diff --git a/LisergyClient/LisergyClient/Assets/Code/Runtime/UnityServices/Input/GameInputs.cs b/LisergyClient/LisergyClient/Assets/Code/Runtime/UnityServices/Input/GameInputs.cs index 085455268..9413d9730 100644 --- a/LisergyClient/LisergyClient/Assets/Code/Runtime/UnityServices/Input/GameInputs.cs +++ b/LisergyClient/LisergyClient/Assets/Code/Runtime/UnityServices/Input/GameInputs.cs @@ -1,8 +1,8 @@ //------------------------------------------------------------------------------ // // This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator -// version 1.5.0 -// from Assets/Code/Runtime/Input/GameInputs.inputactions +// version 1.7.0 +// from Assets/Code/Runtime/UnityServices/Input/GameInputs.inputactions // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. diff --git a/LisergyClient/LisergyClient/Assets/Code/Runtime/UnityServices/UI/GameHUD.cs b/LisergyClient/LisergyClient/Assets/Code/Runtime/UnityServices/UI/GameHUD.cs index ef7d8a1f5..c64ec0634 100644 --- a/LisergyClient/LisergyClient/Assets/Code/Runtime/UnityServices/UI/GameHUD.cs +++ b/LisergyClient/LisergyClient/Assets/Code/Runtime/UnityServices/UI/GameHUD.cs @@ -51,14 +51,15 @@ private async UniTaskVoid OpenBuildSelect() Datasource = GameClient.Modules.Buildings.GetBuildingsKnown().ToList(), OnPreview = (item, element) => { + var constructionSpec = GameClient.Game.Specs.BuildingConstructions[item.SpecId]; element.Description.text = item.Description; - element.Time.text = item.BuildTimeSeconds + " seconds"; - element.CostFromResource(item.BuildingCost); + element.Time.text = $"{constructionSpec.TimeToBuildSeconds} seconds"; + element.CostFromResource(constructionSpec.BuildingCost); }, CreateSelection = b => { var w = new WidgetSelectionItem(); - w.SetData(b.Name, b.Icon, b).Forget(); + w.SetData(b.Name, b.Art, b).Forget(); return w; } }); diff --git a/LisergyClient/LisergyClient/Assets/Packs/UiArt/Sprites/Component/Icon_EquipmentIcons_(x2)/NoShadow/NoShadow.unitypackage.meta b/LisergyClient/LisergyClient/Assets/Packs/UiArt/Sprites/Component/Icon_EquipmentIcons_(x2)/NoShadow/NoShadow.unitypackage.meta deleted file mode 100644 index bb1b2c941..000000000 --- a/LisergyClient/LisergyClient/Assets/Packs/UiArt/Sprites/Component/Icon_EquipmentIcons_(x2)/NoShadow/NoShadow.unitypackage.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 4d59add17a4538948b683487c39d45ba -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/LisergyClient/LisergyClient/Assets/Packs/UiArt/Sprites/Component/Icon_EquipmentIcons_(x2)/Shadow/Shadow.unitypackage.meta b/LisergyClient/LisergyClient/Assets/Packs/UiArt/Sprites/Component/Icon_EquipmentIcons_(x2)/Shadow/Shadow.unitypackage.meta deleted file mode 100644 index 2ada1464f..000000000 --- a/LisergyClient/LisergyClient/Assets/Packs/UiArt/Sprites/Component/Icon_EquipmentIcons_(x2)/Shadow/Shadow.unitypackage.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 3674cee6e2c342746bb001dbf996ee38 -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/LisergyClient/LisergyClient/Assets/Packs/UiArt/Sprites/Component/Icon_ItemIcons_(x2)/NoShadow/NoShadow.unitypackage.meta b/LisergyClient/LisergyClient/Assets/Packs/UiArt/Sprites/Component/Icon_ItemIcons_(x2)/NoShadow/NoShadow.unitypackage.meta deleted file mode 100644 index ffea89608..000000000 --- a/LisergyClient/LisergyClient/Assets/Packs/UiArt/Sprites/Component/Icon_ItemIcons_(x2)/NoShadow/NoShadow.unitypackage.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 4505f4750d8b8ce489f10367d20de9d8 -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/LisergyClient/LisergyClient/Assets/Packs/UiArt/Sprites/Component/Icon_ItemIcons_(x2)/Shadow/Shadow.unitypackage.meta b/LisergyClient/LisergyClient/Assets/Packs/UiArt/Sprites/Component/Icon_ItemIcons_(x2)/Shadow/Shadow.unitypackage.meta deleted file mode 100644 index 8ec8b208f..000000000 --- a/LisergyClient/LisergyClient/Assets/Packs/UiArt/Sprites/Component/Icon_ItemIcons_(x2)/Shadow/Shadow.unitypackage.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 994a4edb15473dd40be060352440fb7e -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/LisergyClient/LisergyClient/Assets/Packs/UiArt/Sprites/Component/Icon_PictoIcons_(x2)/PictoIcons_(x2).unitypackage.meta b/LisergyClient/LisergyClient/Assets/Packs/UiArt/Sprites/Component/Icon_PictoIcons_(x2)/PictoIcons_(x2).unitypackage.meta deleted file mode 100644 index a11e036f7..000000000 --- a/LisergyClient/LisergyClient/Assets/Packs/UiArt/Sprites/Component/Icon_PictoIcons_(x2)/PictoIcons_(x2).unitypackage.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 431a1d52393e2474ab334a53d72cdf4c -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/LisergyClient/LisergyClient/Assets/Plugins/ClientSDK.dll b/LisergyClient/LisergyClient/Assets/Plugins/ClientSDK.dll index 66b75ddd1..72e169d9e 100644 --- a/LisergyClient/LisergyClient/Assets/Plugins/ClientSDK.dll +++ b/LisergyClient/LisergyClient/Assets/Plugins/ClientSDK.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:be7be8b5d65692c6054d42331c3c4607c72f3061483f7fb6e091fb755977d3fc +oid sha256:2acb6b7840a9d11a13b1db672167df813d1859182cfa285bb18833f2aac4011e size 33792 diff --git a/LisergyClient/LisergyClient/Assets/Plugins/Game.dll b/LisergyClient/LisergyClient/Assets/Plugins/Game.dll index 58f5e79a4..5f03f6e00 100644 --- a/LisergyClient/LisergyClient/Assets/Plugins/Game.dll +++ b/LisergyClient/LisergyClient/Assets/Plugins/Game.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3f12c2c971db7f69cb34f27ffcfd16250fdb47af67fe6c5433bee26607f511b1 +oid sha256:b2467b85cc3d6c9e1de6d1fc28656a1a182a79db25025c4ebf6eb1cce74a51fa size 185344 diff --git a/LisergyClient/LisergyClient/Assets/Plugins/GameData.dll b/LisergyClient/LisergyClient/Assets/Plugins/GameData.dll index 1e40808aa..d96eaf9f5 100644 --- a/LisergyClient/LisergyClient/Assets/Plugins/GameData.dll +++ b/LisergyClient/LisergyClient/Assets/Plugins/GameData.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6b9470cb7ecbb322ad6ecfc62f6c0811059a5a4f91dc9a1f221174b376bc2032 +oid sha256:ccb58be41d6d84dd7c6afd39ca64a635192eb0583c695f1af80949b93a1ca9ac size 11776 diff --git a/LisergyClient/LisergyClient/ProjectSettings/ProjectVersion.txt b/LisergyClient/LisergyClient/ProjectSettings/ProjectVersion.txt index 224decfe3..307ccd351 100644 --- a/LisergyClient/LisergyClient/ProjectSettings/ProjectVersion.txt +++ b/LisergyClient/LisergyClient/ProjectSettings/ProjectVersion.txt @@ -1,2 +1,2 @@ -m_EditorVersion: 2022.3.20f1 -m_EditorVersionWithRevision: 2022.3.20f1 (61c2feb0970d) +m_EditorVersion: 2022.3.19f1 +m_EditorVersionWithRevision: 2022.3.19f1 (244b723c30a6) diff --git a/LisergyServer/ClientSDK/ClientSDK.csproj b/LisergyServer/ClientSDK/ClientSDK.csproj index e3c68162d..6a1f7239e 100644 --- a/LisergyServer/ClientSDK/ClientSDK.csproj +++ b/LisergyServer/ClientSDK/ClientSDK.csproj @@ -20,9 +20,10 @@ + - + diff --git a/LisergyServer/Core/BaseServer.csproj b/LisergyServer/Core/BaseServer.csproj index 015733410..b19ca190b 100644 --- a/LisergyServer/Core/BaseServer.csproj +++ b/LisergyServer/Core/BaseServer.csproj @@ -2,7 +2,7 @@ Library - net8.0 + net6.0 true diff --git a/LisergyServer/RedisMagic/EventPool.cs b/LisergyServer/Game/Engine/DataTypes/EventPool.cs similarity index 100% rename from LisergyServer/RedisMagic/EventPool.cs rename to LisergyServer/Game/Engine/DataTypes/EventPool.cs diff --git a/LisergyServer/RedisMagic/FastNew.cs b/LisergyServer/Game/Engine/DataTypes/FastNew.cs similarity index 100% rename from LisergyServer/RedisMagic/FastNew.cs rename to LisergyServer/Game/Engine/DataTypes/FastNew.cs diff --git a/LisergyServer/Game/Engine/ECS/ComponentPointers.cs b/LisergyServer/Game/Engine/ECS/ComponentPointers.cs index 4468b796f..2bd28660d 100644 --- a/LisergyServer/Game/Engine/ECS/ComponentPointers.cs +++ b/LisergyServer/Game/Engine/ECS/ComponentPointers.cs @@ -66,7 +66,7 @@ public IComponent AsInterface(Type t) /// Will attempt to reuse any free memory if available. /// - public void Alloc() where T : IComponent => this[typeof(T)] = UnmanagedMemory.Alloc(sizeof(T)); + public void Alloc() where T : IComponent => this[typeof(T)] = UnmanagedMemory.Alloc(Marshal.SizeOf()); public void Alloc(Type t) => this[t] = UnmanagedMemory.Alloc(Marshal.SizeOf(t)); diff --git a/LisergyServer/Game/Game.csproj b/LisergyServer/Game/Game.csproj index 3b5f47fa9..d19ec5c41 100644 --- a/LisergyServer/Game/Game.csproj +++ b/LisergyServer/Game/Game.csproj @@ -18,11 +18,11 @@ - + diff --git a/LisergyServer/RedisMagic/SDL.csproj b/LisergyServer/RedisMagic/SDL.csproj index 81ac33729..0e5225cd1 100644 --- a/LisergyServer/RedisMagic/SDL.csproj +++ b/LisergyServer/RedisMagic/SDL.csproj @@ -1,7 +1,7 @@  - net8.0 + net6.0 enable enable @@ -12,4 +12,8 @@ + + + + diff --git a/LisergyServer/StandaloneServer/StandaloneServer.csproj b/LisergyServer/StandaloneServer/StandaloneServer.csproj index 70327458d..f86dd8f59 100644 --- a/LisergyServer/StandaloneServer/StandaloneServer.csproj +++ b/LisergyServer/StandaloneServer/StandaloneServer.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net6.0 enable enable