From: misomosi Date: Mon, 18 May 2026 06:59:20 +0000 (-0400) Subject: Add initial OSFE proposal sources X-Git-Url: http://git.misomosispi.com/?a=commitdiff_plain;h=88bc4c01afcbe1525f6e2d65eecd37abd18d3849;p=radev.git Add initial OSFE proposal sources --- diff --git a/OSFE/.gitignore b/OSFE/.gitignore new file mode 100644 index 0000000..5e82362 --- /dev/null +++ b/OSFE/.gitignore @@ -0,0 +1,4 @@ +# Don't distribute the copyrighted game DLLs, make modders provide their own +lib/*.dll +bin/ +obj/ diff --git a/OSFE/README.md b/OSFE/README.md new file mode 100644 index 0000000..c3f2f97 --- /dev/null +++ b/OSFE/README.md @@ -0,0 +1,29 @@ +# One Step from Eden Standalone + +Proposal for Standalone Support for One Step from Eden + +## One Step from Eden Modding Intro + +One Step from Eden supports mods via LibHarmony and the Steam workshop + +LibHarmony allows you to patch a large variety of things in the +C# application it is loaded in, and we can use this to essentially +patch any method or class that we would like to patch. + +## Hardcore Implementation + +There are two methods to install mods. One is through the Steam Workshop +and the other is through the local Mods folder. + +The local mods are always loaded and they are loaded before Steam Workshop mods. +They can also be assigned a priority to prefer some local mods over others. + +Steam workshop mods can be toggled active or inactive and they can be also be assigned a priority. +Most mods assign a priority of 0, some have a higher finite value (i.e. MoreLuaPower uses 1000). + +RetroAchievements must load before any other mod to enforce hardcore mode restrictions, +so we should assign ourselves a priority of "+Infinity" and check that there are no local +mods installed (we should be a Steam workshop mod) and that all other mods have finite priorities. + +Of course, anyone could cheat and load before us and mess with this process, but it's +useful to prevent accidental mod loading and make it a bit harder for people to cheat. diff --git a/OSFE/RetroAchievements.cs b/OSFE/RetroAchievements.cs new file mode 100644 index 0000000..dd96cb5 --- /dev/null +++ b/OSFE/RetroAchievements.cs @@ -0,0 +1,33 @@ +using HarmonyLib; +using System.IO; +using UnityEngine; + +// We don't actually care much about hooking LoadItemData, but it's +// called soon after mods are loaded, so it gives us an early entrypoint +[HarmonyPatch(typeof(ItemManager), "LoadItemData")] +internal class EntryPoint +{ + // TODO: + // If we are in hardcore mode, do a basic check to make sure no other mods are loaded. + // This is a clientside check, so there's only so much we can do, but make a good effort + // to prevent accidents and require at least some hacking knowledge to cheat. + // * This is a steam workshop project, so ensure Mods folder is empty (Those mods loaded unconditionally, first) + // * Make sure we have a priority of Infinity + // * Make sure all other Steam workshop projects have a finite priority + static EntryPoint() + { + Debug.Log("Hello World!"); + } + static void Prefix() {} +} + +[HarmonyPatch(typeof(ModCtrl), "_InstallTheseMods")] +internal class InstallTheseMods_patch +{ + // TODO: Allow loading of mods in softcore + static bool Prefix(FileInfo[] fileInfo, string modsDir) + { + Debug.Log("Nope! Can't install any more mods! Not allowed!"); + return false; + } +} diff --git a/OSFE/RetroAchievements.csproj b/OSFE/RetroAchievements.csproj new file mode 100644 index 0000000..7542c9e --- /dev/null +++ b/OSFE/RetroAchievements.csproj @@ -0,0 +1,116 @@ + + + + 9.0 + net452 + true + true + + + + lib/0Harmony.dllFalse + lib/Assembly-CSharp-firstpass.dllFalse + lib/Assembly-CSharp.dllFalse + lib/E7.Introloop.dllFalse + lib/GalaxyCSharp.dllFalse + lib/Mono.Posix.dllFalse + lib/Mono.Security.dllFalse + lib/Rewired_Core.dllFalse + lib/Rewired_Windows.dllFalse + lib/Sirenix.OdinInspector.Attributes.dllFalse + lib/Sirenix.OdinInspector.CompatibilityLayer.dllFalse + lib/Sirenix.Serialization.AOTGenerated.dllFalse + lib/Sirenix.Serialization.Config.dllFalse + lib/Sirenix.Serialization.dllFalse + lib/Sirenix.Utilities.dllFalse + lib/SonicBloom.Koreo.dllFalse + lib/SonyNP.dllFalse + lib/SonyPS4CommonDialog.dllFalse + lib/SonyPS4SaveData.dllFalse + lib/System.Configuration.dllFalse + lib/System.Core.dllFalse + lib/System.Data.dllFalse + lib/System.Drawing.dllFalse + lib/System.EnterpriseServices.dllFalse + lib/System.Net.Http.dllFalse + lib/System.Numerics.dllFalse + lib/System.Runtime.Serialization.dllFalse + lib/System.Security.dllFalse + lib/System.ServiceModel.Internals.dllFalse + lib/System.Transactions.dllFalse + lib/System.Xml.Linq.dllFalse + lib/System.Xml.dllFalse + lib/System.dllFalse + lib/TwitchLib.Unity.dllFalse + lib/Unity.Analytics.DataPrivacy.dllFalse + lib/Unity.Analytics.StandardEvents.dllFalse + lib/Unity.Analytics.Tracker.dllFalse + lib/Unity.TextMeshPro.dllFalse + lib/UnityEngine.AIModule.dllFalse + lib/UnityEngine.ARModule.dllFalse + lib/UnityEngine.AccessibilityModule.dllFalse + lib/UnityEngine.AnimationModule.dllFalse + lib/UnityEngine.AssetBundleModule.dllFalse + lib/UnityEngine.AudioModule.dllFalse + lib/UnityEngine.BaselibModule.dllFalse + lib/UnityEngine.ClothModule.dllFalse + lib/UnityEngine.ClusterInputModule.dllFalse + lib/UnityEngine.ClusterRendererModule.dllFalse + lib/UnityEngine.CoreModule.dllFalse + lib/UnityEngine.CrashReportingModule.dllFalse + lib/UnityEngine.DirectorModule.dllFalse + lib/UnityEngine.FileSystemHttpModule.dllFalse + lib/UnityEngine.GameCenterModule.dllFalse + lib/UnityEngine.GridModule.dllFalse + lib/UnityEngine.HotReloadModule.dllFalse + lib/UnityEngine.IMGUIModule.dllFalse + lib/UnityEngine.ImageConversionModule.dllFalse + lib/UnityEngine.InputModule.dllFalse + lib/UnityEngine.JSONSerializeModule.dllFalse + lib/UnityEngine.LocalizationModule.dllFalse + lib/UnityEngine.Networking.dllFalse + lib/UnityEngine.ParticleSystemModule.dllFalse + lib/UnityEngine.PerformanceReportingModule.dllFalse + lib/UnityEngine.Physics2DModule.dllFalse + lib/UnityEngine.PhysicsModule.dllFalse + lib/UnityEngine.ProfilerModule.dllFalse + lib/UnityEngine.ScreenCaptureModule.dllFalse + lib/UnityEngine.SharedInternalsModule.dllFalse + lib/UnityEngine.SpatialTracking.dllFalse + lib/UnityEngine.SpriteMaskModule.dllFalse + lib/UnityEngine.SpriteShapeModule.dllFalse + lib/UnityEngine.StreamingModule.dllFalse + lib/UnityEngine.StyleSheetsModule.dllFalse + lib/UnityEngine.SubstanceModule.dllFalse + lib/UnityEngine.TLSModule.dllFalse + lib/UnityEngine.TerrainModule.dllFalse + lib/UnityEngine.TerrainPhysicsModule.dllFalse + lib/UnityEngine.TextCoreModule.dllFalse + lib/UnityEngine.TextRenderingModule.dllFalse + lib/UnityEngine.TilemapModule.dllFalse + lib/UnityEngine.Timeline.dllFalse + lib/UnityEngine.TimelineModule.dllFalse + lib/UnityEngine.UI.dllFalse + lib/UnityEngine.UIElementsModule.dllFalse + lib/UnityEngine.UIModule.dllFalse + lib/UnityEngine.UNETModule.dllFalse + lib/UnityEngine.UmbraModule.dllFalse + lib/UnityEngine.UnityAnalyticsModule.dllFalse + lib/UnityEngine.UnityConnectModule.dllFalse + lib/UnityEngine.UnityTestProtocolModule.dllFalse + lib/UnityEngine.UnityWebRequestAssetBundleModule.dllFalse + lib/UnityEngine.UnityWebRequestAudioModule.dllFalse + lib/UnityEngine.UnityWebRequestModule.dllFalse + lib/UnityEngine.UnityWebRequestTextureModule.dllFalse + lib/UnityEngine.UnityWebRequestWWWModule.dllFalse + lib/UnityEngine.VFXModule.dllFalse + lib/UnityEngine.VRModule.dllFalse + lib/UnityEngine.VehiclesModule.dllFalse + lib/UnityEngine.VideoModule.dllFalse + lib/UnityEngine.WindModule.dllFalse + lib/UnityEngine.XRModule.dllFalse + lib/UnityEngine.dllFalse + lib/com.rlabrecque.steamworks.net.dllFalse + lib/mscorlib.dllFalse + + diff --git a/OSFE/WorkshopItemInfo.xml b/OSFE/WorkshopItemInfo.xml new file mode 100644 index 0000000..12e28bf --- /dev/null +++ b/OSFE/WorkshopItemInfo.xml @@ -0,0 +1,8 @@ + + RetroAchievements + Integrate with RetroAchievements + + +Infinity + 0 + 1.3 + diff --git a/OSFE/workshopIcon.png b/OSFE/workshopIcon.png new file mode 100644 index 0000000..7f4398b Binary files /dev/null and b/OSFE/workshopIcon.png differ