#Json Api crash game
1 messages · Page 1 of 1 (latest)
Hey, please don't ping devs.
I will look at it
i know but its been month that ma trying to get attention to this :/ sorry again
From what I can see, the issue is one of your mod, which is using DPL_SCR_BaseGameMode::SendPlayerList
this only happens when the mod is used on a server with more than 64 players tho
(it list the players, get some data from collector and send it as json to my web api)
From what I can see, you are not the only one. But without a repro, without having to bother 64 people, hard to know
you need to repro yourself on your machine or can we do something to a live server to help debug this ?
Did you made it not public mod ?
I can't seem to find it in the workshop directly
Otherwise, just send me the source of the mod in PM
Could it be possible that you did not call
Pack() before calling AsString() on the JsonApiStruct?
If the packing is not done, or if the packing fails. HasData() will return false.
And if you then call AsString(), while HasData() is false, it might return a invalid value and crash.
A hotfix for you could be to check HasData() first.
I assume probably the packing is just failing, for whateeever reason.
There is this message
ProcessPack() :: Max allowed size of JSON exceed limits
If that gets printed, the Pack() has failed.
and HasData() will be false and AsString() will be invalid.
I got one crashreport from you from 24th december
10:50:06.820 BACKEND (E): JsonApi - All buffers are depleted!
10:50:06.820 BACKEND (E): ProcessPack() :: Cannot allocate buffer !!!
10:50:06.820 BACKEND (E): Packing failed - canceling save for file "PlayerData.3a2009c4-2182-4a6f-afaa-a776a8d0867d.json"
10:50:19.251 BACKEND (E): JsonApi - All buffers are depleted!
10:50:19.252 BACKEND (E): ProcessPack() :: Cannot allocate buffer !!!
10:50:19.252 BACKEND (E): JsonApi - All buffers are depleted!
10:50:19.252 BACKEND (E): ProcessPack() :: Cannot allocate buffer !!!
10:50:19.253 ENGINE (F): Crashed
10:50:19.330 ENGINE (E): Application crashed! Generated memory dump:
So indeed seems to be that. Different error message, same thing.
Just looked back at it and tripped over a number.
There are a total of 64 json buffers. When these are all occupied, that above happens.
You said about 64 players.. thats too close to be a coincidence.
Might it be that you are Packing 64 json structs at once?
If you pack one, to string it, discard it.
Instead of
pack 64
to string them
discard 64
then that might workaround the issue
@winter vapor If you see people pinging me specifically it's because I am officially the point of contact for modding, so you can ping me but not other devs. It's even against the rules of the discord.
hum i pack only one variable but it has an array so not sure
m_PlayerListJson.SaveToFile(DPL_FILE_PATH);
m_PlayerListJson.Pack();
string playerListJson = m_PlayerListJson.AsString();
the player list is in this m_PlayerListJson variable that has this property for the players ->
ref array<ref DPL_PlayerInfoJson> players = new array<ref DPL_PlayerInfoJson>();
niirozz told me to use this https://community.bistudio.com/wiki/Arma_Reforger:Serialisation so gonna try with SCR_JsonSaveContext instead