Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ModSync.Server/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const DEFAULT_CONFIG = `{
// Fika
"user/mods/fika-server/types",
"user/mods/fika-server/cache",
"BepInEx/plugins/Fika.Dedicated.dll",
"BepInEx/plugins/Fika.Headless.dll",
// Live Flea Prices
"user/mods/zzDrakiaXYZ-LiveFleaPrices/config",
// Questing Bots
Expand Down
20 changes: 10 additions & 10 deletions ModSync/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class Plugin : BaseUnityPlugin
private static readonly string LOCAL_EXCLUSIONS_PATH = Path.Combine(MODSYNC_DIR, "Exclusions.json");
private static readonly string UPDATER_PATH = Path.Combine(Directory.GetCurrentDirectory(), "ModSync.Updater.exe");

private static readonly List<string> DEDICATED_DEFAULT_EXCLUSIONS =
private static readonly List<string> HEADLESS_DEFAULT_EXCLUSIONS =
[
"BepInEx/plugins/AmandsGraphics.dll",
"BepInEx/plugins/AmandsSense.dll",
Expand Down Expand Up @@ -80,11 +80,11 @@ public class Plugin : BaseUnityPlugin
+ createdDirectories[syncPath.path].Count
)
.Sum();
private static bool IsDedicated => Chainloader.PluginInfos.ContainsKey("com.fika.dedicated");
private static bool IsHeadless => Chainloader.PluginInfos.ContainsKey("com.fika.headless");
private List<SyncPath> EnabledSyncPaths => syncPaths.Where(syncPath => configSyncPathToggles[syncPath.path].Value || syncPath.enforced).ToList();

private bool SilentMode =>
IsDedicated
IsHeadless
|| EnabledSyncPaths.All(syncPath =>
syncPath.silent
|| (
Expand Down Expand Up @@ -215,7 +215,7 @@ private async Task SyncMods(SyncPathFileList filesToAdd, SyncPathFileList filesT

totalDownloadCount = downloadTasks.Count;

if (!IsDedicated)
if (!IsHeadless)
progressWindow.Show();

while (downloadTasks.Count > 0 && !cts.IsCancellationRequested)
Expand All @@ -233,7 +233,7 @@ private async Task SyncMods(SyncPathFileList filesToAdd, SyncPathFileList filesT

cts.Cancel();
progressWindow.Hide();
if (!IsDedicated)
if (!IsHeadless)
downloadErrorWindow.Show();
}

Expand All @@ -255,7 +255,7 @@ private async Task SyncMods(SyncPathFileList filesToAdd, SyncPathFileList filesT
Directory.Delete(PENDING_UPDATES_DIR, true);
pluginFinished = true;
}
else if (!IsDedicated)
else if (!IsHeadless)
restartWindow.Show();
else
StartUpdaterProcess();
Expand Down Expand Up @@ -284,7 +284,7 @@ private void StartUpdaterProcess()
{
List<string> options = [];

if (IsDedicated)
if (IsHeadless)
options.Add("--silent");

Logger.LogInfo($"Starting Updater with arguments {string.Join(" ", options)} {Process.GetCurrentProcess().Id}");
Expand Down Expand Up @@ -412,17 +412,17 @@ private IEnumerator StartPlugin()
}

Logger.LogDebug("Loading local exclusions");
if (IsDedicated && !VFS.Exists(LOCAL_EXCLUSIONS_PATH))
if (IsHeadless && !VFS.Exists(LOCAL_EXCLUSIONS_PATH))
{
try
{
VFS.WriteTextFile(LOCAL_EXCLUSIONS_PATH, Json.Serialize(DEDICATED_DEFAULT_EXCLUSIONS));
VFS.WriteTextFile(LOCAL_EXCLUSIONS_PATH, Json.Serialize(HEADLESS_DEFAULT_EXCLUSIONS));
}
catch (Exception e)
{
Logger.LogError(e);
Chainloader.DependencyErrors.Add(
$"Could not load {Info.Metadata.Name} due to error writing local exclusions file for dedicated client. Please check BepInEx/LogOutput.log for more information."
$"Could not load {Info.Metadata.Name} due to error writing local exclusions file for headless client. Please check BepInEx/LogOutput.log for more information."
);
yield break;
}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ This project allows clients to easily add/update/remove mods, keeping them in sy

> The ModSync Updater (client-only) requires the
> [.NET 8.0 runtime](https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/runtime-8.0.11-windows-x64-installer).
> If you use the launcher, you'll have it, but dedicated clients may need to manually install it.
> If you use the launcher, you'll have it, but headless clients may need to manually install it.

1. Download the latest version of the mod from the [GitHub Releases](https://github.com/c-orter/modsync/releases) page
2. Extract into your SPT folder like any other mod
Expand Down