Skip to content

Commit

Permalink
Merge pull request #772 from LavaGang/alpha-development
Browse files Browse the repository at this point in the history
MelonLoader v0.6.6
  • Loading branch information
HerpDerpinstine authored Oct 15, 2024
2 parents b73c427 + d40b26a commit 732a6d4
Show file tree
Hide file tree
Showing 58 changed files with 1,667 additions and 997 deletions.
20 changes: 16 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ jobs:
xcopy BaseLibs\net6 Output\Debug\x64\MelonLoader\net6\ /E /H /Y
echo.
echo Copying Dobby x64...
xcopy BaseLibs\dobby_x64.dll Output\Debug\x64\dobby.dll*
xcopy BaseLibs\dobby_x64.dll Output\Debug\x64\MelonLoader\Dependencies\dobby.dll*
echo.
echo Copying documentation files...
copy NOTICE.txt Output\Debug\x64
Expand All @@ -189,6 +189,8 @@ jobs:
copy LICENSE.md Output\Debug\x64\MelonLoader\Documentation\
copy NOTICE.txt Output\Debug\x64\MelonLoader\Documentation\
copy README.md Output\Debug\x64\MelonLoader\Documentation\
del Output\Debug\x64\MelonLoader\net6\MelonStartScreen.dll
del Output\Debug\x64\MelonLoader\net6\MelonStartScreen.deps.json
- uses: actions/upload-artifact@v4
name: Upload Zip | Windows - x64
with:
Expand Down Expand Up @@ -224,7 +226,7 @@ jobs:
xcopy BaseLibs\net6 Output\Debug\x86\MelonLoader\net6\ /E /H /Y
echo.
echo Copying Dobby x86...
xcopy BaseLibs\dobby_x86.dll Output\Debug\x86\dobby.dll*
xcopy BaseLibs\dobby_x86.dll Output\Debug\x86\MelonLoader\Dependencies\dobby.dll*
echo.
echo Copying documentation files...
copy NOTICE.txt Output\Debug\x86
Expand All @@ -233,6 +235,8 @@ jobs:
copy LICENSE.md Output\Debug\x86\MelonLoader\Documentation\
copy NOTICE.txt Output\Debug\x86\MelonLoader\Documentation\
copy README.md Output\Debug\x86\MelonLoader\Documentation\
del Output\Debug\x86\MelonLoader\net6\MelonStartScreen.dll
del Output\Debug\x86\MelonLoader\net6\MelonStartScreen.deps.json
- uses: actions/upload-artifact@v4
name: Upload Zip | Windows - x86
with:
Expand Down Expand Up @@ -268,7 +272,7 @@ jobs:
xcopy BaseLibs\net6 Output\Release\x64\MelonLoader\net6\ /E /H /Y
echo.
echo Copying Dobby x64...
xcopy BaseLibs\dobby_x64.dll Output\Release\x64\dobby.dll*
xcopy BaseLibs\dobby_x64.dll Output\Release\x64\MelonLoader\Dependencies\dobby.dll*
echo.
echo Copying documentation files...
copy NOTICE.txt Output\Release\x64
Expand All @@ -277,6 +281,8 @@ jobs:
copy LICENSE.md Output\Release\x64\MelonLoader\Documentation\
copy NOTICE.txt Output\Release\x64\MelonLoader\Documentation\
copy README.md Output\Release\x64\MelonLoader\Documentation\
del Output\Release\x64\MelonLoader\net6\MelonStartScreen.dll
del Output\Release\x64\MelonLoader\net6\MelonStartScreen.deps.json
- uses: actions/upload-artifact@v4
name: Upload Zip | Windows - x64
with:
Expand Down Expand Up @@ -312,7 +318,7 @@ jobs:
xcopy BaseLibs\net6 Output\Release\x86\MelonLoader\net6\ /E /H /Y
echo.
echo Copying Dobby x86...
xcopy BaseLibs\dobby_x86.dll Output\Release\x86\dobby.dll*
xcopy BaseLibs\dobby_x86.dll Output\Release\x86\MelonLoader\Dependencies\dobby.dll*
echo.
echo Copying documentation files...
copy NOTICE.txt Output\Release\x86
Expand All @@ -321,6 +327,8 @@ jobs:
copy LICENSE.md Output\Release\x86\MelonLoader\Documentation\
copy NOTICE.txt Output\Release\x86\MelonLoader\Documentation\
copy README.md Output\Release\x86\MelonLoader\Documentation\
del Output\Release\x86\MelonLoader\net6\MelonStartScreen.dll
del Output\Release\x86\MelonLoader\net6\MelonStartScreen.deps.json
- uses: actions/upload-artifact@v4
name: Upload Zip | Windows - x86
with:
Expand Down Expand Up @@ -362,6 +370,8 @@ jobs:
copy LICENSE.md Output\Debug\x64\MelonLoader\Documentation\
copy NOTICE.txt Output\Debug\x64\MelonLoader\Documentation\
copy README.md Output\Debug\x64\MelonLoader\Documentation\
del Output\Debug\x64\MelonLoader\net6\MelonStartScreen.dll
del Output\Debug\x64\MelonLoader\net6\MelonStartScreen.deps.json
- uses: actions/upload-artifact@v4
name: Upload Zip | Linux - x64
with:
Expand Down Expand Up @@ -403,6 +413,8 @@ jobs:
copy LICENSE.md Output\Release\x64\MelonLoader\Documentation\
copy NOTICE.txt Output\Release\x64\MelonLoader\Documentation\
copy README.md Output\Release\x64\MelonLoader\Documentation\
del Output\Release\x64\MelonLoader\net6\MelonStartScreen.dll
del Output\Release\x64\MelonLoader\net6\MelonStartScreen.deps.json
- uses: actions/upload-artifact@v4
name: Upload Zip | Linux - x64
with:
Expand Down
3 changes: 1 addition & 2 deletions Bootstrap/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
[package]
name = "Bootstrap"
version = "0.1.0"
version = "0.6.6"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
#unity-rs = { path = "C:/Users/sarah/Documents/rust/Ferrex/unity/" }
unity-rs = { git = "https://github.com/RinLovesYou/Ferrex/", rev = "77d114c" }
ctor = "0.2.6"
chrono = "0.4.23"
Expand Down
4 changes: 2 additions & 2 deletions Bootstrap/src/base_assembly/mono.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub fn init(runtime: &FerrexRuntime) -> Result<(), DynErr> {
let _runtime_dir = paths::runtime_dir()?;

//get MelonLoader.dll's path and confirm it exists
let mut melonloader_dll = _runtime_dir.join("MelonLoader.dll");
let melonloader_dll = _runtime_dir.join("MelonLoader.dll");

if !melonloader_dll.exists() {
return Err("MelonLoader.dll not found".into());
Expand All @@ -42,7 +42,7 @@ pub fn init(runtime: &FerrexRuntime) -> Result<(), DynErr> {

//get the AssemblyManager class and grab some methods from it
let assemblymanager_class = melonloader_assembly.get_class(
"MelonLoader.MonoInternals.ResolveInternals",
"MelonLoader.Resolver",
"AssemblyManager",
runtime,
)?;
Expand Down
2 changes: 1 addition & 1 deletion Bootstrap/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub type InvokeFnIl2Cpp = extern "C" fn(
pub type InitFnMono = extern "C" fn(*const c_char, *const c_char) -> *mut MonoDomain;
pub type InitFnIl2Cpp = extern "C" fn(*const c_char) -> *mut Il2CppDomain;

pub const MELON_VERSION: &str = "0.6.5";
pub const MELON_VERSION: &str = "0.6.6";

pub const IS_ALPHA: bool = false;

Expand Down
8 changes: 4 additions & 4 deletions Bootstrap/src/icalls/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ pub fn init(runtime: &FerrexRuntime) -> Result<(), DynErr> {
runtime.add_internal_call("MelonLoader.MelonUtils::IsGame32Bit", melon_utils::is_32_bit as MethodPointer)?;
runtime.add_internal_call("MelonLoader.BootstrapInterop::NativeHookAttach", bootstrap_interop::attach as MethodPointer)?;
runtime.add_internal_call("MelonLoader.BootstrapInterop::NativeHookDetach", bootstrap_interop::detach as MethodPointer)?;
runtime.add_internal_call("MelonLoader.MonoInternals.MonoLibrary::GetLibPtr", mono_library::get_lib_ptr as MethodPointer)?;
runtime.add_internal_call("MelonLoader.MonoInternals.MonoLibrary::CastManagedAssemblyPtr", mono_library::cast_assembly_ptr as MethodPointer)?;
runtime.add_internal_call("MelonLoader.MonoInternals.MonoLibrary::GetRootDomainPtr", mono_library::get_domain_ptr as MethodPointer)?;
runtime.add_internal_call("MelonLoader.MonoInternals.ResolveInternals.AssemblyManager::InstallHooks", resolve_internals::install_hooks as MethodPointer)?;
runtime.add_internal_call("MelonLoader.Utils.MonoLibrary::GetLibPtr", mono_library::get_lib_ptr as MethodPointer)?;
runtime.add_internal_call("MelonLoader.Utils.MonoLibrary::CastManagedAssemblyPtr", mono_library::cast_assembly_ptr as MethodPointer)?;
runtime.add_internal_call("MelonLoader.Utils.MonoLibrary::GetRootDomainPtr", mono_library::get_domain_ptr as MethodPointer)?;
runtime.add_internal_call("MelonLoader.Resolver.AssemblyManager::InstallHooks", resolve_internals::install_hooks as MethodPointer)?;
runtime.add_internal_call("MelonLoader.Support.Preload::GetManagedDirectory", preload::get_managed_dir as MethodPointer)?;

Ok(())
Expand Down
3 changes: 2 additions & 1 deletion Bootstrap/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// #![allow(non_snake_case)]
#![allow(non_snake_case)]

// #![deny(
// missing_debug_implementations,
// unused_results,
Expand Down
25 changes: 12 additions & 13 deletions Bootstrap/src/melonenv/paths.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,24 @@ lazy_static! {
pub static ref BASE_DIR: W<PathBuf> = {
let args: Vec<String> = std::env::args().collect();
let mut base_dir = std::env::current_dir().unwrap_or_else(|e|internal_failure!("Failed to get base dir: {e}"));
for arg in args.iter() {
let mut iterator = args.iter();
while let Some(mut arg) = iterator.next() {
if arg.starts_with("--melonloader.basedir") {
let a: Vec<&str> = arg.split("=").collect();
base_dir = PathBuf::from(a[1]);
if arg.contains("=") {
let a: Vec<&str> = arg.split("=").collect();
base_dir = PathBuf::from(a[1]);
}
else {
arg = iterator.next().unwrap();
base_dir = PathBuf::from(arg);
}
}
}

W(base_dir)
};
pub static ref GAME_DIR: W<PathBuf> = {
let args: Vec<String> = std::env::args().collect();
let mut base_dir = std::env::current_dir().unwrap_or_else(|e|internal_failure!("Failed to get game dir: {e}"));
for arg in args.iter() {
if arg.starts_with("--melonloader.basedir") {
let a: Vec<&str> = arg.split("=").collect();
base_dir = PathBuf::from(a[1]);
}
}

let base_dir = std::env::current_dir().unwrap_or_else(|e|internal_failure!("Failed to get game dir: {e}"));
W(base_dir)
};
pub static ref MELONLOADER_FOLDER: W<PathBuf> = W(BASE_DIR.join("MelonLoader"));
Expand Down Expand Up @@ -75,7 +74,7 @@ pub fn get_managed_dir() -> Result<PathBuf, DynErr> {

match managed_path.exists() {
true => Ok(managed_path),
false => Err("Failed to find the managed directory!")?,
false => Err("Failed to find the Managed directory!")?,
}
}
}
Expand Down
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
| Versions: |
| - |
| [v0.6.6](#v066) |
| [v0.6.5](#v065) |
| [v0.6.4](#v064) |
| [v0.6.3](#v063) |
Expand Down Expand Up @@ -37,6 +38,31 @@

---

### v0.6.6

1. Updated Il2CppInterop to 1.4.6-ci.579
2. Implemented a RegisterTypeInIl2CppWithInterfaces attribute
3. Implemented Recursive Melon Folders with extended UserLib Resolving
4. Reimplemented NetFramework Variant of Cpp2IL as fallback
5. Standardized Assembly Searching and Resolving to work on both Mono and Il2Cpp Games
6. Temporarily removed Start Screen for being broken in most cases
7. Modified Command-Line Argument Logging to show Internal Arguments Only
8. Added UserLibs folders to Native Library Search Directories
9. Moved `dobby.dll` to `MelonLoader\Dependencies`
10. Moved Assembly Resolver Related Classes to `MelonLoader.Resolver` Namespace
11. Moved `MonoLibrary` class to `MelonLoader.Utils` Namespace
12. Removed Useless TODO Warning from Il2CppAssemblyGenerator
13. Removed EOS Compatibility Layer for being Unneeded
14. Fixed Regression with LemonMD5, LemonSHA256, and LemonSHA512
15. Fixed an issue with older Cpp2IL versions causing a download failure
16. Fixed an issue with Il2CppInterop not properly logging Trampoline Exceptions
17. Fixed an issue with Il2Cpp Class Injection Attributes causing exceptions to be thrown on Mono games
18. Fixed an issue with the Bootstrap not reading `--melonloader.basedir` correctly
19. Fixed an issue with Loading `dobby.dll` in some rare cases
20. Fixed an issue with Compatibility Layers getting Garbage Collected while still in use

---

### v0.6.5

1. Updated Il2CppInterop to 1.4.6-ci.545
Expand Down
Loading

0 comments on commit 732a6d4

Please sign in to comment.