Skip to content

Commit

Permalink
Add server setting for Inertia and improve logging of Config
Browse files Browse the repository at this point in the history
  • Loading branch information
Lacyway committed Jun 20, 2024
1 parent 18922f5 commit 263f01c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
1 change: 1 addition & 0 deletions Fika.Core/FikaPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ private void GetClientConfig()
AllowItemSending = clientConfig.AllowItemSending;
BlacklistedItems = clientConfig.BlacklistedItems;
ForceSaveOnDeath = clientConfig.ForceSaveOnDeath;
UseInertia = clientConfig.UseInertia;

clientConfig.ToString();
}
Expand Down
24 changes: 22 additions & 2 deletions Fika.Core/Models/ClientConfigModel.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Reflection;
using System;
using System.Reflection;
using System.Runtime.Serialization;

namespace Fika.Core.UI.Models
Expand Down Expand Up @@ -27,7 +28,10 @@ public struct ClientConfigModel
[DataMember(Name = "forceSaveOnDeath")]
public bool ForceSaveOnDeath;

public ClientConfigModel(bool useBTR, bool friendlyFire, bool dynamicVExfils, bool allowFreeCam, bool allowItemSending, string[] blacklistedItems, bool forceSaveOnDeath)
[DataMember(Name = "useInertia")]
public bool UseInertia;

public ClientConfigModel(bool useBTR, bool friendlyFire, bool dynamicVExfils, bool allowFreeCam, bool allowItemSending, string[] blacklistedItems, bool forceSaveOnDeath, bool useInertia)
{
UseBTR = useBTR;
FriendlyFire = friendlyFire;
Expand All @@ -36,6 +40,7 @@ public ClientConfigModel(bool useBTR, bool friendlyFire, bool dynamicVExfils, bo
AllowItemSending = allowItemSending;
BlacklistedItems = blacklistedItems;
ForceSaveOnDeath = forceSaveOnDeath;
UseInertia = useInertia;
}

public new void ToString()
Expand All @@ -45,6 +50,21 @@ public ClientConfigModel(bool useBTR, bool friendlyFire, bool dynamicVExfils, bo
foreach (FieldInfo field in fields)
{
object value = field.GetValue(this);
if (value is Array valueArray)
{
string values = "";
for (int i = 0; i < valueArray.Length; i++)
{
if (i == 0)
{
values = valueArray.GetValue(i).ToString();
continue;
}
values = values + ", " + valueArray.GetValue(i).ToString();
}
FikaPlugin.Instance.FikaLogger.LogInfo(field.Name + ": " + values);
continue;
}
FikaPlugin.Instance.FikaLogger.LogInfo(field.Name + ": " + value);
}
}
Expand Down

0 comments on commit 263f01c

Please sign in to comment.