Skip to content
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

[1.2] Make properties async #76

Merged
merged 12 commits into from
Mar 9, 2019
Merged

[1.2] Make properties async #76

merged 12 commits into from
Mar 9, 2019

Conversation

markatk
Copy link
Member

@markatk markatk commented Mar 9, 2019

This PR converts all properties which use native RageMP functions to async getter/setters.

@markatk markatk added this to the V1.2 milestone Mar 9, 2019
@markatk markatk changed the title Make properties async [1.2] Make properties async Mar 9, 2019
@markatk markatk marked this pull request as ready for review March 9, 2019 19:17
@markatk markatk force-pushed the make-properties-async branch from 2a00270 to 59a7cbf Compare March 9, 2019 19:20
{
CheckExistence();

return await _plugin.Schedule(() => StructConverter.PointerToStruct<Vector3>(Rage.Checkpoint.Checkpoint_GetDirection(NativePointer))).ConfigureAwait(false);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move PointerToStruct convert out of scheduled lambda


return Rage.Player.Player_IsJumping(NativePointer);
}
return await _plugin.Schedule(() => StringConverter.PointerToString(Rage.Player.Player_GetKickReason(NativePointer))).ConfigureAwait(false);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move PointerToString call outside scheduled method


return _plugin.VehiclePool[Rage.Vehicle.Vehicle_GetTrailer(NativePointer)];
}
return await _plugin.Schedule(() => _plugin.VehiclePool[Rage.Vehicle.Vehicle_GetTrailer(NativePointer)]).ConfigureAwait(false);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move _plugin.VehiclePool call out of schedule

/// <exception cref="EntityDeletedException">This entity was deleted before</exception>
float Scale { get; set; }
/// <param name="direction">New direction of the marker</param>
/// <returns></returns>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant <returns></returns>

@markatk markatk force-pushed the make-properties-async branch from 4eba7d3 to 7c77360 Compare March 9, 2019 21:10
@Micky5991 Micky5991 merged commit 1580cec into develop Mar 9, 2019
@markatk markatk deleted the make-properties-async branch March 10, 2019 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants