Changelog
This version is dedicated to a greatly improved usability and stability towards our current goal to create a crash-resistant API.
We tried to create an API that is all async, but we came to the point that this way of implementing it introduced a hig overhead while calling it. So now we offer next to all async-methods their sync versions. This gives the opportunity to group calls into their own MP.Schedule
-call and reduce the needed scheduling calls to a minimum. This should not introduce a more compicated way of implementing it, because MP.Utility.Schedule
should be awaitable as every API, too.
Example:
// Before
public async Task DoSomethingAsync(IPlayer player) {
await player.SpawnAsync();
await player.SetHealthAsync(50);
await player.SetPositionAsync(new Vector3(50f, 50f, 50f));
await player.SetRotationAsync(new Vector3(0f, 0f, 12f);
}
// After
public async Task DoSomethingAsync(IPlayer player) {
await MP.Utility.Schedule(() => {
player.Spawn();
player.SetHealth(50);
player.SetPosition(new Vector3(50f, 50f, 50f));
player.SetRotation(new Vector3(0f, 0f, 12f);
});
}
Added
- Added new CommandHandler that is able to parse parameters and convert them to fit the given signature.
See documentation
Changed
- Reworked all asynchronous methods and added synchronized variants.
- Reduced dockerimage size from ~800MB to ~80 MB.
- Set all versions in Dockerimage dependencies to a fixed version to avoid unwanted upgrades.
- Replaced all events with .NET coding convention compliant versions.
(object sender, EventArgs args)
- All parameters that contained
ColorRgba
now useSystem.Drawing.Color
instead. - Moved
MP.Joaat
andMP.Schedule
toMP.Utility
class.
Deprecated
MP.Joaat
MP.Schedule
Changes between V1.1.4 and V1.2.0
Upgrade-Guide from V1.1.4 to V1.2.0