Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.NET 6 Cross platform #341

Merged
merged 136 commits into from
Sep 19, 2022
Merged

.NET 6 Cross platform #341

merged 136 commits into from
Sep 19, 2022

Conversation

Rans4ckeR
Copy link
Contributor

@Rans4ckeR Rans4ckeR commented Jun 12, 2022

Updated frameworks

  • .NET 4.8
    • DirectX targets AnyCPU
    • OpenGL targets AnyCPU
    • XNA targets x86
  • .NET 6.0:
    • net6.0-windows: WinForms, Windows 7 and up
    • net6.0: cross platform
    • DirectX targets AnyCPU
    • OpenGL targets AnyCPU
    • XNA targets x86

Updated dependencies

  • New Rampastring.Tools NuGet package
  • New Rampastring.XNAUI.* NuGet packages
    • XNA 4.0 Refresh
    • MonoGame DX & GL 3.8.0 (.NET 4.8)
    • MonoGame DX & GL 3.8.1 (.NET 6.0)
  • Replaced Ionic.Zip with System.IO.Compression
  • Use Izo.net NuGet package
  • Use OpenMcdf NuGet package
  • New ClientUpdater local NuGet package

Build

  • Switch to new project file format
  • New solution configurations and platforms
    • Configurations: AresWindowsDXDebug;AresUniversalGLDebug;AresWindowsGLDebug;AresWindowsXNADebug;
      AresWindowsDXRelease;AresUniversalGLRelease;AresWindowsGLRelease;AresWindowsXNARelease;
      TSWindowsDXDebug;TSUniversalGLDebug;TSWindowsGLDebug;TSWindowsXNADebug;
      TSWindowsDXRelease;TSUniversalGLRelease;TSWindowsGLRelease;TSWindowsXNARelease;
      YRWindowsDXDebug;YRUniversalGLDebug;YRWindowsGLDebug;YRWindowsXNADebug;
      YRWindowsDXRelease;YRUniversalGLRelease;YRWindowsGLRelease;YRWindowsXNARelease
    • Platforms: AnyCPU, x86, x64, ARM64
  • Includes .editorconfig with my default warning rules. This triggers many new warnings. The rules can be reviewed and updated, or I can fix the current warnings in another PR.
  • Note: Switching between XNA or MonoGame configurations within Visual Studio may require you to unload and reload the ClientCore project (or restart VS) regarding MonoGame/XNA dependencies

Cross platform

  • Adds an additional .NET6.0 'UniversalGL' build without WinForms. Allows client to be run on any device with .NET6.0 installed (new Rampastring.XNAUI package).

  • Improves .NET4.8 compatibility on Mono

  • Cross platform building (build on Linux, run on Windows and vice versa)

  • Tested (YR):

    • .NET4.8 WindowsGL on Mono (WSL2 Ubuntu 20.04)
    • .NET6.0 UniversalGL on WSL2 Ubuntu 20.04
    • .NET6.0 UniversalGL on Fedora 36.1.5
    • .NET6.0 UniversalGL on Windows 11
    • All other existing builds on Windows 11
  • Changes:

    • Uses the platform safe SafePath methods for handling file system path operations (new Rampastring.Tools package)
    • Replaced WinForms Clipboard with TextCopy
    • Replaced WinForms/System.Drawing with ImageSharp
    • Replaced WinForms Screen with XNA GraphicsAdapter.DefaultAdapter
    • Replaced WindowsIdentity.GetCurrent().Name with Environment.UserName
  • Windows specific functionality currently disabled on other platforms:

    • Use of .cur mouse cursor files
      • Win API LoadCursorFromFile
    • Flash window
      • Win API FlashWindowEx
    • WindowManager; Minimize, Maximize, Hide, ...
      • WinForms
    • DTA/TI/TS Compatibility Fix (DisplayOptionsPanel)
      • Registry (Microsoft.Win32)
      • Windows application sdbinst.exe
    • FinalSun Compatibility Fix (DisplayOptionsPanel)
      • Registry (Microsoft.Win32)
      • Windows application sdbinst.exe
    • Log hardware info (Startup)
      • WMI (System.Management)
    • Generate OnlineId (Startup)
      • Registry (Microsoft.Win32)
      • SecurityIdentifier (System.Security.Principal.Windows)
      • WMI (System.Management)

Prerequisites for this PR:

@github-actions
Copy link

github-actions bot commented Jun 12, 2022

Nightly build for this pull request:

  • artifacts.zip
    This comment is automatic and is meant to allow guests to get latest automatic builds without registering. It is updated on every successful build.

@Metadorius
Copy link
Member

LGTM on your front 😄

- Updater DLL filename has been changed from `DTAUpdater.dll` to `ClientUpdater.dll` and second-stage updater from `clientupdt.dat` to `SecondStageUpdater.exe` and has been moved from base folder to `Resources`.

- To support launching the game on Linux a file named `wine-dta.sh` must be present in the game root folder. For use with wine the file should contain `wine gamemd-spawn.exe $*` where `gamemd-spawn.exe` is replaced with the game executable. Note that users will need to execute `chmod u+x wine-dta.sh` once to allow it to be launched.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Actually the client has a special entry in clientdefinitions which allows specifying any filename, not only wine-dta.sh.
  2. The instructions for launching the game differ for DLL injector based mods, for example, like Syringe or Vinifera.
  3. Not sure about chmod'ing, wonder if the updater sets or could set the correct permissions if they are set on the FTP server...

Docs/Migration.md Outdated Show resolved Hide resolved
Docs/Migration.md Outdated Show resolved Hide resolved
Rans4ckeR and others added 10 commits September 17, 2022 16:58
* Update build

Co-authored-by: frg2089 <frg2089@outlook.com>
Co-authored-by: Kerbiter <crabiter@vivaldi.net>
Co-authored-by: Kerbiter <crabiter@vivaldi.net>
* refact build script

Signed-off-by: 舰队的偶像-岛风酱! <frg2089@outlook.com>
@Metadorius Metadorius merged commit 7edcf34 into CnCNet:develop Sep 19, 2022
@Rans4ckeR Rans4ckeR deleted the net6 branch November 16, 2023 20:05
SadPencil pushed a commit to SadPencil/xna-cncnet-client that referenced this pull request Oct 4, 2024
Co-authored-by: 舰队的偶像-岛风酱! <frg2089@outlook.com>
SadPencil pushed a commit to SadPencil/xna-cncnet-client that referenced this pull request Oct 4, 2024
Co-Authored-By: 舰队的偶像-岛风酱! <frg2089@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants