roflmuffin / CounterStrikeSharp

CounterStrikeSharp allows you to write server plugins in C# for Counter-Strike 2/Source2/CS2
https://docs.cssharp.dev
Other
742 stars 111 forks source link

JsonConverter for Vector and QAngle broken with dotnet 8 #390

Closed B3none closed 5 months ago

B3none commented 5 months ago

When people are running v201 there's an issue with dotnet 8 which is caused by the way the Vector and QAngle classes are implemented.

Here's a link to my JsonConverter: https://github.com/B3none/cs2-retakes/blob/master/RetakesPlugin/Modules/Configs/JsonConverters/VectorJsonConverter.cs

Errors posted by community member: https://pastes.io/uwpu4xdcya

It seems to be related to these lines: https://github.com/roflmuffin/CounterStrikeSharp/blob/e4d598dba8b1c93ec36bee517d1e329458776984/managed/CounterStrikeSharp.API/Modules/Utils/Vector.cs#L48-L50

B3none commented 5 months ago

@ipsvn sent this: https://github.com/dotnet/runtime/issues/95893

He also made the PR to fix it in my plugin too 👍

It seems to be an issue with the JsonConverter attributes not being loaded in dotnet8 for some reason, but I can confirm this is not an error with CounterStrikeSharp. Although the Vector and Qangle classes do need some refinement 👀

Here's his PR for context: https://github.com/B3none/cs2-retakes/pull/94/files

For now I'll close this ticket as it's not a CounterStrikeSharp issue.