You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can see that it is challenging to predict future game versions and in the same time keep plugin working for the largest number of game binary versions.
To do it effectively, you could first verify what you need, if it fails, then inform user that different plugin version is needed, if it succeeds let it load.
To make it happen, you could use __try and __except keywords. https://stackoverflow.com/a/7049836
intFilterException(int code, PEXCEPTION_POINTERS ex) {
return EXCEPTION_EXECUTE_HANDLER;
}
voidSomeCheckingOfNeededGameStuff()
{
// check if game_ctrl_u object is really game_ctrl// check if game_actor_u object is really game_actor// etc// if anything goes bad and throws exception, it will be catched in __except block.
}
boolShouldPluginBeRunning()
{
__try {
SomeCheckingOfNeededGameStuff();
returntrue; // all went fine
}
__except(FilterException(GetExceptionCode(), GetExceptionInformation())) {
returnfalse;
}
}
Real code might be different, and I am not sure if you can return false just like that from __except block. But I think it should be all possible.
Thank you for understanding.
The text was updated successfully, but these errors were encountered:
Thank you, I don't know much about c++ so I did not know __try/__catch even existed, I think I tried the std try/catch at some point but that was only able to catch std exceptions.
The version checker I added last plugin version only checks 1.xx, I didn't really expect SCS to do a .5 update.
And I indeed don't really want to constantly have to update this for every smaller binary change. So it wasn't able to catch the .5 update unfortunately.
I will look into it and hopefully stop the crashes once and for all, thanks again.
And sorry for any issues/extra work the plugin crashes have caused for you and the TruckersMP team.
Hello,
I can see that it is challenging to predict future game versions and in the same time keep plugin working for the largest number of game binary versions.
To do it effectively, you could first verify what you need, if it fails, then inform user that different plugin version is needed, if it succeeds let it load.
To make it happen, you could use
__try
and__except
keywords.https://stackoverflow.com/a/7049836
Real code might be different, and I am not sure if you can return false just like that from __except block. But I think it should be all possible.
Thank you for understanding.
The text was updated successfully, but these errors were encountered: