After about 30 to 40 seconds adaptive cards seem to just time out any help would be nice here is my code
Seems to me like it could be a bug. If youâre able to reproduce it on various artifact versions and different machines then I suggest filling out a bug report and make sure to use the template and provide enough detail and a repro for the devs to be able to fix it.
I believe I saw someone talk about something similar on DC but no repro was ever provided.
this happens not just in adaptive cards but normal deferrals.
to fix this you can use deferalls.update every x amount of intervals. idk if it will work or not but try
and use deferalls.done after message!
@Hriday08 Put the card in a loop every 10 seconds to send the card again just seems to cause the timeout when the card changes
@termanator1128 tried with the latest artifacts same issue also got a friend to connect and again the adaptive card timed out for him also tried with my localhost and a windows server on different network
Iâd go ahead and submit a bug report then.
Hey! So players on my Server have the exact same issue. But they are already in the âdownloading contentâ-stage. So when they are new on my server and they are âdownloading contentâ (which might take some time) they just time out at some point. But I donât use a custom adaptive card before.
Is there any solution idea?
You are presenting the adaptive card and then you return
, there is no call to deferrals.done(âreasonâ) in this case and probably why it gets held up and timed out.
The other thing I notice is that you do not use a Citizen.CreateThread at any point, Iâm not sure whatâs going on in the rest of your -- rest isnt needed
section of the code but youâre likely blocking the main thread with waits.
This seems to work good for me in lua:
AddEventHandler('playerConnecting', function(name, reason, deferrals)
local _adaptiveCard = adaptiveCardDefault
deferrals.defer()
deferrals.presentCard(_adaptiveCard)
local _source = source
Citizen.CreateThread(function()
-- rest of player connecting code here
-- you can update the card contents by changing the _adaptiveCard table properties as needed
end)
end