How x606/modbot works
Main System Components
• Core Mod Loader (Mod Bot): This is the heart of the system. It contains modules for injecting mod code during runtime, handling mod downloads and management, patching game code, managing UI elements, and reflecting/injecting into the host game.
• Injection & Patching Modules: Found in folders such as InjectionClasses, Internal/Patches, and Internal/Reflection. These manage code injection (using techniques likely tied to Harmony and reflection) into the game process.
• Mod Handling & Utilities: Located under Mod Bot/ModHandling, ModUtilities, and ModdedUpgrades. This side of the system deals with downloading mods, managing mod metadata, handling upgrades, and providing supportive functions from the ModLibrary namespace.
• Scripting Support: The Internal/Scripting folder (with support for JavaScript and Lua script objects) shows that the system supports runtime scripting to extend functionality in a dynamic way.
• Unity Integration/Plugin: The UnityProject directory contains Unity assets, prefabs, scenes, and a “Mod-Bot Unity plugin.” This indicates that parts of the system integrate with the game’s frontend (UI, asset bundles, level editors) leveraging Unity’s rendering and asset pipelines.
• Website/API Integration: The ModBotWebsiteAPI folder indicates integration with an external website (modbot.org) for actions like the “!modsuggest <mod id>” command and scenarios where commands or mod suggestions are received from Twitch.
• External Dependencies: The UsedDlls folder (and references in the built version) is used to integrate critical dependencies from the game (e.g., Harmony, SharpZipLib, ModLibrary DLLs).
Interactions and Data Flow
• The Mod Handling and Utilities modules receive mod data (download info, metadata, settings) and pass it to the Core for processing. Show bidirectional flows where configuration data, mod loading, and error management are exchanged.
• The Website/API component communicates externally. Link “ModBotWebsiteAPI” with the Core to reflect the Twitch command processing and mod suggestion functionality. Show an external internet boundary labeled “modbot.org” for website interactions.
Architectural Patterns and Technologies
• Dependency Injection / Reflection: Note that the system uses injection techniques (as shown by Injections.cs and Reflection folders) to manage dynamic behavior.
• Integration with External Systems: Add a note regarding integration technologies such as the Harmony library for patching, and that Unity is used for front-end challenges.
• Testing: Include a nod to the ModBotUnitTests module, emphasizing that the system is also designed to be testable.