Skip to content

Conversation

@SadPencil
Copy link
Member

@SadPencil SadPencil commented Jul 9, 2025

This PR contains partial fix from #718

  • Fix in some cases the loading screen might hang forever. Delay using XNAMessageBox as the DisplayErrorAction until the main menu has been loaded. Otherwise, if there are any exceptions be thrown when parsing the maps, the loading screen will hang for a long time (maybe forever but I am not sure).
  • Add missing messages on existing Debug.Assert

@SadPencil SadPencil requested a review from Copilot July 9, 2025 12:14
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR ensures the loading screen no longer hangs if map parsing errors occur by moving the error-display setup into the main menu initialization, and it enriches existing debug assertions with descriptive messages.

  • Changed how and when DisplayErrorAction is assigned to prevent hangs on startup.
  • Updated Debug.Assert calls to include explanatory messages in two channel‐related files.
  • Tweaked exception logging null safety and made HandleException publicly accessible.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
DXMainClient/PreStartup.cs Added null-conditional on TargetSite.Name, made HandleException public, used named parameter for clarity.
DXMainClient/Online/Channel.cs Updated comment and added message string to Debug.Assert for users collection.
DXMainClient/DXGUI/Multiplayer/CnCNet/CnCNetLobby.cs Added message string to Debug.Assert in RefreshPlayerList.
DXMainClient/DXGUI/Generic/MainMenu.cs Moved DisplayErrorAction assignment into PostInit to defer error dialogs.
DXMainClient/DXGUI/GameClass.cs Removed previous DisplayErrorAction assignment from Initialize.
Comments suppressed due to low confidence (2)

DXMainClient/PreStartup.cs:244

  • Changing HandleException from static (package‐private) to public static alters the class's API surface. Confirm this exposure is intentional and update any documentation or consumers accordingly.
        public static void HandleException(object sender, Exception ex)

DXMainClient/DXGUI/Generic/MainMenu.cs:656

  • This new error‐display behavior should be covered by unit or integration tests to verify that errors during map parsing invoke this DisplayErrorAction and that the application handles exit correctly.
            MainClientConstants.DisplayErrorAction = (title, error, exit) =>

@github-actions
Copy link

github-actions bot commented Jul 9, 2025

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.

@SadPencil SadPencil merged commit 1e8ddf7 into CnCNet:develop Jul 9, 2025
1 check passed
@SadPencil SadPencil deleted the delay-show-error-in-xnaui branch July 9, 2025 12:18
@SadPencil SadPencil added this to the 2.12.6 milestone Jul 9, 2025
idshen pushed a commit to idshen/Sxna-cncnet-client that referenced this pull request Oct 11, 2025
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.

1 participant