Upgrade FreeSO to .NET 9.0#283
Conversation
build as Class Libary succeeds in VS2022, I have not tried building game, need to migrate all other first
build as Class Libary succeeds in VS2022, I have not tried building game, need to migrate all other first
Need to look at packages later, it somehow compiles
The FSO.Server project needs to exclude the Admin folder, as node_modules can contain cs files for build scripts
|
Hi! Thank you for the review and for taking the time to test it. The performance improvements are awesome to see, it really shows what improvements the newer version can do already I’m working through your notes and making improvements. A few updates from my side:
<Target Name="CopyMonoGameDLLs" AfterTargets="Build">
next..
|
|
For Volcanic, I don't think I can't release the archive data right now as it hasn't been fully stripped of sensitive data (and it would mean essentially publishing a release with a lot unfinished). I guess it's possible to make an "empty" archive template, but that might take a while to do. I'll try and look at the NLog and lot server connection handshake issues myself, since I know the most about the process anyways it should be less trouble for me. |
Refactors MP3Player to replace old thread-based decoding and buffer management with a .NET 9.0 async/Task-based implementation using ConcurrentQueue and SemaphoreSlim. Improves performance, reduces GC pressure with ArrayPool<byte>, and makes resource management and cancellation more reliable. Simplifies buffer submission logic and adds preload/buffer tuning options.
Added .idea/ directory to .gitignore to prevent JetBrains Rider IDE files from being tracked in the repository.
and made the application work again, because .NET 9 no longer supports AppDomain.CreateDomain. and AppDomainSetup.ConfigurationFile is also removed in .NET Core/.NET 5+
There was a problem hiding this comment.
I figured out the issue I was having, it's an SQLite problem where it puts an int32 into the database instead of a uint32, then errors trying to cast it on retrieval. I've pushed a workaround on the archive branch, since it might actually happen there, too.
I don't think this should be enabled on any of our projects:
<Nullable>enable</Nullable>
It'll just cause warnings everywhere right now, and would need the whole project to be reworked to properly annotate everything.
About the AppDomain use in the server updater, I can't really remember why I added it in the first place. The solution I settled on later on was just alternating running the patcher and the game using a watchdog script, so it's probably fine.
For the ApiClient methods that you've made async, you should use _ = ... to discard the explicitly discard the tasks so that the warnings don't appear. Awaiting them doesn't do anything useful since the data comes back on the callback.
I haven't been able to test the normal server or update process, but it's likely those are broken on the archive branch anyways so it's better to fix them when I come back around to cleaning everything up.
Things are looking pretty good now. Whenever you want a final review set the PR as non-draft and I'll give it another look.
| <ItemGroup> | ||
| <None Include="NLog.config"> | ||
| <None Update="config.json"> |
There was a problem hiding this comment.
Does this file exist? config.sample.json does, but it doesn't seem to be copied to the output directory now...
Refactor FSOFacadeWorker login logic and update project files - Removed config.json from FSO.Server output - Added discord-rpc.dll to FSO.UI - Refactored login logic in FSOFacadeWorker to remove async/await - Updated method calls to use discard (_) for tasks
During migration, this method was made async to get the project to build properly. But now it builds succesfuly without async, so restoring the original archive branch implementation.
|
Which Monogame is used, it allows the custom modifications? |
Currently, its using the official latest |
|
Still youre using the Monogame linker classes or just package dependency |
|
It's using the Monogame linker so arguments can be passed to launch the game with a different backend. |
Fixes that sometimes after closing the game, it not fully closes, it was still running in the background. - It works but is it good to call Environment.Exit(0); ? or are there maybe background processes running that are not finshed yet, and i just kill now?
Fixes some/most of the scaling issues in Volcanic for dotnet9, and updates default font to modern Segoe UI.
|
I think I've solved the issue with the game not closing as well as properly waiting for the archive server to shut down with this change: Let me know if it fixes it for you. You can cherry-pick it into this branch if it works. |
Should prevent the game from accidentally staying open and fix the archive closing dialog
|
Yes, that change works for me, the game closes cleanly now on both IDE and Windows. I’ve cherry-picked it into this branch. Thanks! |
There was a problem hiding this comment.
Things are looking good for now, apart from some small issues:
- The Dispose performance issue. My fork has published development packages with the change, but GitHub's nuget store is pretty much useless for public projects since you need to login with a PAT token to read any public packages. On top of that being annoying to set up. Visual Studio asks me to re-enter the PAT token every time I start it. I've made a PR to upstream this over on the MonoGame repository, but I'm not sure when it'll be merged: MonoGame/MonoGame#9027
- This isn't really blocking anything, it just makes the game a bit more stuttery.
- FSOFacadeWorker appears to be trying to use DesktopGL monogame instead of WindowsDX. The custom graphics device code only works on the DX backend.
- There are some visual issues in the IDE from changing the font (it's generally wider than the old one)
- The HighDpi mode set in FSO.IDE doesn't work properly.
If you're good with everything so far, unmark it as draft and I'll merge.
| @@ -68,6 +68,8 @@ public void InitVolcanic(string[] args) | |||
| { | |||
| Application.EnableVisualStyles(); | |||
| Application.SetCompatibleTextRenderingDefault(false); | |||
| Application.SetDefaultFont(new Font(new FontFamily("Segoe UI"), 8.25f)); | |||
| Application.SetHighDpiMode(HighDpiMode.PerMonitorV2); | |||
There was a problem hiding this comment.
Ah, that’s not good! Guess the DPI setting should to be removed









Hi! I’m upgrading FreeSO to .NET 9.0, It is currently working and playable! There are still some areas for improvement. I wanted it to place it here already so it can be used, and maybe collaborate together.
MonoGameversion.Microsoft.Extensions.DependencyInjectionand consider modern alternatives for most older libraries?