fivem icon indicating copy to clipboard operation
fivem copied to clipboard

[MonoV2] deferrals.presentCard in PlayerConnecting event leads to a crash

Open Keyinator opened this issue 8 months ago • 0 comments

What happened?

The following code:

[EventHandler("PlayerConnecting")]
private async Coroutine HandleConnecting([Source] Player player, string playerName, dynamic setKickReason, dynamic deferrals) {
  deferrals.defer();
  deferrals.presentCard(AdaptiveCardText, new Action<dynamic, string>((data, rawData) => {
    //Do nothing
  })
}

leads to the crash * Assertion at sgen-alloc.c:378, condition `*p == NULL' not met

(An example adaptive card can be obtained from https://adaptivecards.io/designer/ using the content of the card payload editor)

Expected result

The card should be shown to the client

Reproduction steps

[EventHandler("PlayerConnecting")]
private async Coroutine HandleConnecting([Source] Player player, string playerName, dynamic setKickReason, dynamic deferrals) {
  deferrals.defer();
  deferrals.presentCard(AdaptiveCardText, new Action<dynamic, string>((data, rawData) => {
    //Do nothing
  })
}

Importancy

Crash

Area(s)

FiveM, FXServer, ScRT: C#

Specific version(s)

Version: FXServer-master v1.0.0.8552 linux with OneSync enabled

Additional information

No response

Keyinator avatar Jun 16 '24 20:06 Keyinator