You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
Luckily right before a big release we noticed a big problem in conversions with enums.
The problem is the following:
Lets assume we have an enum with the following values:
PlayerType: {Unknown, Player 1, Player 2, Player 3}
We created a struct that has these 4 options as well.
Now we release that version with the struct containing those 4 options.
After that we decide to implement a 4th player type (Player 4).
In the backend we add that player type, but our users still run the "old" unreal software.
These old clients receive a json response from the backend that can say PlayerType = Player 4.
If that is actually the case the plugin will throw an error and json2struct conversion fails completely, even if this was just one little thing in a big nested struct. We need it to use a default value instead, so we can handle unknown players.
I fixed it by only throwing a warning instead of aborting.
In my fix it will always choose the first enum value in this case.
The text was updated successfully, but these errors were encountered:
Hi,
Luckily right before a big release we noticed a big problem in conversions with enums.
The problem is the following:
Lets assume we have an enum with the following values:
PlayerType: {Unknown, Player 1, Player 2, Player 3}
We created a struct that has these 4 options as well.
Now we release that version with the struct containing those 4 options.
After that we decide to implement a 4th player type (Player 4).
In the backend we add that player type, but our users still run the "old" unreal software.
These old clients receive a json response from the backend that can say PlayerType = Player 4.
If that is actually the case the plugin will throw an error and json2struct conversion fails completely, even if this was just one little thing in a big nested struct. We need it to use a default value instead, so we can handle unknown players.
I fixed it by only throwing a warning instead of aborting.
In my fix it will always choose the first enum value in this case.
The text was updated successfully, but these errors were encountered: