-
Notifications
You must be signed in to change notification settings - Fork 13
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
Clean up and extend ArkApiUtils. #18
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IApiUtils
is an exported class. It looks like you've mostly avoided falling victim to AsaApi's DLL Export Hell by adding new versions of functions. But there are a couple problem spots.
/** | ||
* \brief Converts FVector into coords that are displayed when you view the ingame map | ||
*/ | ||
FORCEINLINE MapCoords FVectorToCoords(FVector actor_position) | ||
FORCEINLINE MapCoords FVectorToCoords(const FVector& position) const |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before:
?FVectorToCoords@IApiUtils@AsaApi@@QEAA?AUMapCoords@2@U?$TVector@N@Math@UE@@@Z
After:
?FVectorToCoords@IApiUtils@AsaApi@@QEBA?AUMapCoords@2@AEBU?$TVector@N@Math@UE@@@Z
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a purposeful breaking change to avoid copies and better reflect the intent of the function.
Recompiling plugins against the new api version would resolve the issue -- we can also force export this with the old name with a linker comment.
@@ -783,14 +915,24 @@ namespace AsaApi | |||
* \param _this Player controller | |||
* \param Command Command to run | |||
*/ | |||
void RunHiddenCommand(AShooterPlayerController* _this, FString* Command) | |||
void RunHiddenCommand(AShooterPlayerController* _this, const FString* Command) const |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before:
?RunHiddenCommand@IApiUtils@AsaApi@@QEAAXPEAUAShooterPlayerController@@PEAVFString@@@Z
After:
?RunHiddenCommand@IApiUtils@AsaApi@@QEBAXPEAUAShooterPlayerController@@PEBVFString@@@Z
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a purposeful breaking change to better reflect the intent of the function.
Recompiling plugins against the new api version would resolve the issue -- we can also force export this with the old name with a linker comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't bother me :) I don't know if many plugins are even using RunHiddenCommand()
. And I imagine FVectorToCoords()
is mostly getting inlined anyways.
Personally, there's a lot of exports I wouldn't mind seeing broken (a whole lot of FString exports that could have just been defined in headers with NativeCall
, among other things). Maybe if the dev team doesn't mind potentially breaking existing plugins, then there's hope for cleaning up some other exports as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, I am also not a fan of a singleton for ApiUtils.
This is just the first of a larger set of changes -- realistically we wouldn't push a new API version officially until most things are cleaned up and developers have time to recompile plugins.
With that said, we should also be using Git tags to help version the API so that people can download the latest stable source more easily, even if there are changes to master.
Needs rigorous testing before merging