Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel Slomka authored and Gabriel Slomka committed May 12, 2024
1 parent c83e774 commit 59b7100
Show file tree
Hide file tree
Showing 23 changed files with 41 additions and 62 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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: []
Expand Down Expand Up @@ -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: []
Expand Down Expand Up @@ -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: []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -12,7 +12,7 @@ namespace Code.Editor
public class AddressableGeneration
{
// Path Contains -> Enum Name
private static readonly Dictionary<string, string> CONFIG = new Dictionary<string, string>()
private static readonly Dictionary<string, string> CONFIG = new ()
{
{"Sfx", "SoundFX"},
{"Tiles", "TilePrefab"},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
});
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion LisergyClient/LisergyClient/Assets/Plugins/ClientSDK.dll
Git LFS file not shown
2 changes: 1 addition & 1 deletion LisergyClient/LisergyClient/Assets/Plugins/Game.dll
Git LFS file not shown
2 changes: 1 addition & 1 deletion LisergyClient/LisergyClient/Assets/Plugins/GameData.dll
Git LFS file not shown
Original file line number Diff line number Diff line change
@@ -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)
3 changes: 2 additions & 1 deletion LisergyServer/ClientSDK/ClientSDK.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@
</ItemGroup>

<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Condition="$([MSBuild]::IsOSPlatform('OSX'))" Command="cp -vf $(TargetPath) $(SolutionDir)/../LisergyClient/LisergyClient/Assets/Plugins/ClientSDK.dll" />
<Exec Condition="$([MSBuild]::IsOSPlatform('Linux'))" Command="cp -vf $(TargetPath) $(SolutionDir)/../LisergyClient/LisergyClient/Assets/Plugins/ClientSDK.dll" />
<Exec Condition="$([MSBuild]::IsOSPlatform('Windows'))" Command="xcopy /y /s /f $(TargetPath) $(SolutionDir)\..\LisergyClient\LisergyClient\Assets\Plugins\ClientSDK.dll*" />
<Exec Condition="$([MSBuild]::IsOSPlatform('OSX'))" Command="cp -vf $(OutDir)ClientSDK.xml $(SolutionDir)/../LisergyClient/LisergyClient/Assets/Plugins/ClientSDK.xml" />
<Exec Condition="$([MSBuild]::IsOSPlatform('Linux'))" Command="cp -vf $(OutDir)ClientSDK.xml $(SolutionDir)/../LisergyClient/LisergyClient/Assets/Plugins/ClientSDK.xml" />
<Exec Condition="$([MSBuild]::IsOSPlatform('Windows'))" Command="xcopy /y /s /f $(OutDir)ClientSDK.xml $(SolutionDir)\..\LisergyClient\LisergyClient\Assets\Plugins\ClientSDK.xml*" />
</Target>
Expand Down
2 changes: 1 addition & 1 deletion LisergyServer/Core/BaseServer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>

Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion LisergyServer/Game/Engine/ECS/ComponentPointers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public IComponent AsInterface(Type t)
/// Will attempt to reuse any free memory if available.
/// </summary>

public void Alloc<T>() where T : IComponent => this[typeof(T)] = UnmanagedMemory.Alloc(sizeof(T));
public void Alloc<T>() where T : IComponent => this[typeof(T)] = UnmanagedMemory.Alloc(Marshal.SizeOf<T>());

public void Alloc(Type t) => this[t] = UnmanagedMemory.Alloc(Marshal.SizeOf(t));

Expand Down
2 changes: 1 addition & 1 deletion LisergyServer/Game/Game.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@

<ItemGroup>
<ProjectReference Include="..\GameData\GameData.csproj" />
<ProjectReference Include="..\RedisMagic\SDL.csproj" />
<ProjectReference Include="..\Serializer\Serializer.csproj" />
</ItemGroup>

<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Condition="$([MSBuild]::IsOSPlatform('OSX'))" Command="cp -vf $(TargetPath) $(SolutionDir)/../LisergyClient/LisergyClient/Assets/Plugins/Game.dll" />
<Exec Condition="$([MSBuild]::IsOSPlatform('Linux'))" Command="cp -vf $(TargetPath) $(SolutionDir)/../LisergyClient/LisergyClient/Assets/Plugins/Game.dll" />
<Exec Condition="$([MSBuild]::IsOSPlatform('Windows'))" Command="xcopy /y /s /f $(TargetPath) $(SolutionDir)\..\LisergyClient\LisergyClient\Assets\Plugins\Game.dll*" />
</Target>
Expand Down
6 changes: 5 additions & 1 deletion LisergyServer/RedisMagic/SDL.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand All @@ -12,4 +12,8 @@
<PackageReference Include="StackExchange.Redis" Version="2.7.27" />
</ItemGroup>

<ItemGroup>
<Compile Remove="TestGenCode.cs" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion LisergyServer/StandaloneServer/StandaloneServer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down

0 comments on commit 59b7100

Please sign in to comment.