{"id":16203196,"url":"https://github.com/pardeike/rimworld-doorstop","last_synced_at":"2025-03-19T07:30:39.726Z","repository":{"id":206850949,"uuid":"717817145","full_name":"pardeike/Rimworld-Doorstop","owner":"pardeike","description":"A Doorstop.dll implementation that also patches mod loading to improve debugging","archived":false,"fork":false,"pushed_at":"2024-10-06T05:29:09.000Z","size":33,"stargazers_count":4,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-28T16:17:34.089Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pardeike.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-12T17:34:44.000Z","updated_at":"2024-10-06T05:29:12.000Z","dependencies_parsed_at":"2024-03-25T01:40:02.412Z","dependency_job_id":"f29bc6fc-34f4-4416-9213-1f815ce203a0","html_url":"https://github.com/pardeike/Rimworld-Doorstop","commit_stats":null,"previous_names":["pardeike/rimworld-doorstop"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pardeike%2FRimworld-Doorstop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pardeike%2FRimworld-Doorstop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pardeike%2FRimworld-Doorstop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pardeike%2FRimworld-Doorstop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pardeike","download_url":"https://codeload.github.com/pardeike/Rimworld-Doorstop/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243975572,"owners_count":20377606,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-10T09:52:43.502Z","updated_at":"2025-03-19T07:30:38.807Z","avatar_url":"https://github.com/pardeike.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rimworld Doorstop\n\nCompanion implementation to [Unity Doorstop](https://github.com/NeighTools/UnityDoorstop).\n\n\u003cimg src=\"https://github.com/pardeike/Rimworld-Doorstop/assets/853584/8fb30d47-63ad-42b6-94ae-93377ad7948e\" width=\"320\" /\u003e\n\n# Why use it\n\nRimWorld uses Unity and the debugger server in Unity isn't available by default. Unity Doorstop fixes this and needs at least some default implementation to run. This project gives you a Doorstop.dll that you can use and has the added benefit of hot-reloading methods that are annotated with the attribute `[Reloadable]`. You can create this attribute in your own code base like this:\n\n```cs\n[AttributeUsage(AttributeTargets.Constructor | AttributeTargets.Method)]\npublic class ReloadableAttribute : Attribute { }\n```\n\n# How to use\n\n### Windows\n\nFirst, install Unity Doorstop by downloading their latest release and put the file `winhttp.dll` and `doorstop_config.ini` in the root directory of RimWorld. The default location of the directory is usually `C:\\Program Files (x86)\\Steam\\steamapps\\common\\RimWorld`.\n\nNext, compile this project or download the release to get `Doorstop.dll` which you put into the games root directly.\n\nYou should now have the contents of the RimWorld root directory look like this:\n```\nData\nMods\nMonoBleedingEdge\nRimWorldWin64_Data\nSource\nDoorstop.dll          \u003c== ADDED BY THIS REPOSITORY\ndoorstop_config.ini   \u003c== ADDED BY UNITY DOORSTOP\nEULA.txt\nLicenses.txt\nModUpdating.txt\nReadme.txt\nRimWorldWin64.exe\nScenarioPreview.jpg\nsteam_appid.txt\nSteamInputDefaultConfiguration.vdf\nSteamInputDefaultConfiguration_SteamDeck.vdf\nUnityCrashHandler64.exe\nUnityPlayer.dll\nVersion.txt\nwinhttp.dll           \u003c== ADDED BY UNITY DOORSTOP\ndoorstop_a6b2ef3.log  \u003c== ADDED EACH TIME YOU START THE GAME\n```\n\nFinally, you need to adjust the `doorstop_config.ini` file a bit. Here is how I define it:\n```\n[General]\nenabled=true\ntarget_assembly=Doorstop.dll\nredirect_output_log=false\nignore_disable_switch=true\n\n[UnityMono]\ndll_search_path_override=\ndebug_enabled=true\ndebug_address=127.0.0.1:56000\ndebug_suspend=false\n```\n\nImportant: Make sure you compile your mod in `Debug` mode so you get `ModName.dll` and `ModName.pdb` into the Mod folder (and please don't release your mod like this!). \n\nNow start the game, then use [dnSpy](https://github.com/dnSpyEx/dnSpy) and open the game dll (usually at `\"C:\\Program Files (x86)\\Steam\\steamapps\\common\\RimWorld\\RimWorldWin64_Data\\Managed\\Assembly-CSharp.dll\"`) and the mod dll you want to debug (usually in `\"C:\\Program Files (x86)\\Steam\\steamapps\\common\\RimWorld\\Mods\\ModName\\.....\\ModName.dll\"`. \n\nYou can also use Visual Studio but you won't be able to set breakpoints in RimWorld code. \n\nFinally, attach to the Unity debugger that runs inside RimWorld (use localhost or 127.0.0.1 and the port you configured in the .ini file) and you should be able to set breakpoints in RimWorld code and in your mod code too.\n\nAny change to a dll inside Mods will create copies of that file and they will be patched in to replace the current version. That only happens for methods that are annotated with some attribute named `[Reloadable]` so make sure you deployed that before you start the game.\n\n### Linux (Ubuntu based) with Rider\n\nDownload the latest Linux [Unity Doorstop](https://github.com/NeighTools/UnityDoorstop/releases) Release. Make sure you grab a numbered version and not the CI Build.\nExtract `/x64/libdoorstop.so` and `/x64/run.sh` into the root directory of RimWorld. The default location of the directory is usually `~/.steam/debian-installation/steamapps/common/RimWorld/`.\n\nNext, compile this project or download the release to get `Doorstop.dll` which you put into the games root directly.\n\nFinally, you need to adjust the `run.sh` file a bit. Adjust the following lines to look like what I have below.\n```\nexecutable_name=\"RimWorldLinux\"\ndebug_enable=\"1\"\ndebug_address=\"127.0.0.1:50000\"\ndebug_suspend=\"1\"\n```\n\nImportant: Make sure you compile your mod in `Debug` mode so you get `ModName.dll` and `ModName.pdb` into the Mod folder (and please don't release your mod like this!). I typically just create symbolic links to my bin/debug folder, but you can do what you like.\n\nNow start the game by running `run.sh` and then use the Run Config \"Attach To Unity Player\" in [Rider](https://www.jetbrains.com/rider/) with Host `127.0.0.1` on Port `50000`.\nThe `debug_suspend=\"1\"` option makes it wait until your debugger is attached to start the game, so don't panic when you don't see the game start immediately.\n\nYou can now put break points in your code in Rider. You can't set breakpoints RimWorld code.\n\nAny change to a dll inside Mods will create copies of that file and they will be patched in to replace the current version. That only happens for methods that are annotated with some attribute named `[Reloadable]` so make sure you deployed that before you start the game.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpardeike%2Frimworld-doorstop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpardeike%2Frimworld-doorstop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpardeike%2Frimworld-doorstop/lists"}