New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[0.12.5]Detours.TryDetourFromTo() doesn't work in Mac OS X (even in Linux) #54
Comments
The code detouring is experimental right now and none of the CCL devs have a Mac to test on. We'll try to sort this issue out and implement an internal platform specific detour to handle this but, it may take some time to sort it out. Thanks for the report. |
Thanks for reply! I know it's quite hard to support multiple platforms even with the power of Unity so it's okay. In the meantime, perhaps you may want to add some platform-specific namespaces like, for example, System.Windows (.NET) or UnityEngine.Windows (Unity) to specify the function is only available in the specific platform. I mean, detour is obviously very useful, especially while Tyran is away, you guys should keep it going, but supporting black magics like detour in multiple platforms at once might be too much. |
93bb86b attempts to fix this. We still can't test, but it didn't break the win version, so I'm updating the 0.12.5 pre-release. Feedback would be great! |
Great! Thank you so much! I'm going to try this on ModVarietyPack and see what happens. EDIT: Tested in my environment using ModVarietyPack 1.24 by replacing its Community Core Library to the latest 0.12.5.3 and... it worked! It spits out a couple of red error lines on boot but it looks like nothing critical. And actually I can play the game with it! Again thank you so much for your help! |
could you post the errros? Also, afaik MVP only uses detours for the extra face images, do they show up in-game? Are you seeing colonists with beards, scars, etc on their face? If not, then the detour probably did not actually work. |
Errors are looked to be related to the MVP itself. It says "Multiple definition files detected" or something like that. I haven't seen that error before though. I just played the game like 15 minutes or so, so yeah... it might not be actually working. I should investigate the situation father more. |
We would still like confirmation one way or the other as to whether the detours work on OS X. If it works on OS X then it works on x64 Linux. Is there any way you can confirm this (ie, MVP's beards and scars, etc)? |
I had multiple modhelper defs. Merging them into on got rid of all these errors. Using CCL 0.12.5.3 with the detour method on custom heads works fine on pc. Can't test on Mac though. |
re: ModHelperDefs re: Detouring |
@simon-82 can you upload the latest version of MVP that uses the pre-release version of CCL and fixed multiple defs. I'm going to try it with a new save game to confirm. |
@akisute Still working on the next release. The multiple defs error shouldn't matter for testing the detour thing. The modded heads are what uses the detour method. Test everything related to those. Just look at prepare carefully and see if the heads with beards / scars are available. Then make some colonists with those heads and see if they work fine in-game. If everything goes well, that should be the confirmation that it works. |
@simon-82 OK! I'll do it as soon as I'm home. Thanks for details! :D |
@simon-82 @ForsakenShell I've tested the pre-release version CCL |
Awesome, all hail E! the master of C# black magic! On Fri, 29 Jan 2016 at 13:15 akisute notifications@github.com wrote:
|
Good job E! 👍 |
You're the C# Ninja, Mr. E 😆 |
I'm glad to see it works on 64-bit systems now. It only took a couple hours of digging to find out what the calling convention under Mac OS X and 64-bit Linux (they use the same) was. I'll do a final code review today and if all goes well there will be a new release. |
I've stuck into the problem regarding to the Detours.TryDetourFromTo() when I was trying the Mod Variety Pack (https://ludeon.com/forums/index.php?topic=16735.msg188326#msg188326). Detours.TryDetourFromTo() is causing a some sort of exception in this case.
As far as I've read its implementation (https://github.com/RimWorldCCLTeam/CommunityCoreLibrary/blob/4038d86aa0cd4a252568f4c46ccde46460fffb9c/DLL_Project/StaticClasses/Detours.cs) there's no wonder why this doesn't work at all. This implementation basically relying on the implementation of the Mono x86-32 runtime, it's too unsafe and of course, it doesn't work in other runtime like x64 (all Macs run in 64 bit, you know). I understand this feature is beneficial, so at least you guys should add a strong warning about using this function like "This function doesn't work other than Windows" to notify mod developers.
The text was updated successfully, but these errors were encountered: