Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions DXMainClient/DXGUI/GameClass.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,18 +148,6 @@ protected override void Initialize()

wm.ControlINIAttributeParsers.Add(new TranslationINIParser());

MainClientConstants.DisplayErrorAction = (title, error, exit) =>
{
new XNAMessageBox(wm, title, error, XNAMessageBoxButtons.OK)
{
OKClickedAction = _ =>
{
if (exit)
Environment.Exit(1);
}
}.Show();
};

SetGraphicsMode(wm);

#if WINFORMS
Expand Down
13 changes: 13 additions & 0 deletions DXMainClient/DXGUI/Generic/MainMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,19 @@ public void PostInit()
CheckRequiredFiles();
CheckForbiddenFiles();
CheckIfFirstRun();

MainClientConstants.DisplayErrorAction = (title, error, exit) =>
{
new XNAMessageBox(WindowManager, title, error, XNAMessageBoxButtons.OK)
{
OKClickedAction = _ =>
{
if (exit)
Environment.Exit(1);
},

}.Show();
};
}

private void LoadThemeSong()
Expand Down
2 changes: 1 addition & 1 deletion DXMainClient/DXGUI/Multiplayer/CnCNet/CnCNetLobby.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1395,7 +1395,7 @@ private void RefreshPlayerList(object sender, EventArgs e)
lbPlayerList.Clear();

// Note: IUserCollection.GetFirst() is not guaranteed to be implemented, unless it is a SortedUserCollection
Debug.Assert(currentChatChannel.Users is SortedUserCollection<ChannelUser>);
Debug.Assert(currentChatChannel.Users is SortedUserCollection<ChannelUser>, "Channel 'users' is supposed to be a SortedUserCollection");
var current = currentChatChannel.Users.GetFirst();
while (current != null)
{
Expand Down
4 changes: 2 additions & 2 deletions DXMainClient/Online/Channel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ public void OnUserListReceived(List<ChannelUser> userList)
existingUser.IsAdmin = user.IsAdmin;
existingUser.IsFriend = user.IsFriend;

// Note: IUserCollection.GetFirst() is not guaranteed to be implemented, unless it is a SortedUserCollection
Debug.Assert(users is SortedUserCollection<ChannelUser>);
// Note: IUserCollection.Reinsert() is not guaranteed to be implemented, unless it is a SortedUserCollection
Debug.Assert(users is SortedUserCollection<ChannelUser>, "Channel 'users' is supposed to be a SortedUserCollection");
users.Reinsert(user.IRCUser.Name);
}
}
Expand Down
6 changes: 3 additions & 3 deletions DXMainClient/PreStartup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -234,16 +234,16 @@ public static void LogException(Exception ex, bool innerException = false)
Logger.Log("Type: " + ex.GetType());
Logger.Log("Message: " + ex.Message);
Logger.Log("Source: " + ex.Source);
Logger.Log("TargetSite.Name: " + ex.TargetSite.Name);
Logger.Log("TargetSite.Name: " + ex.TargetSite?.Name);
Logger.Log("Stacktrace: " + ex.StackTrace);

if (ex.InnerException is not null)
LogException(ex.InnerException, true);
}

static void HandleException(object sender, Exception ex)
public static void HandleException(object sender, Exception ex)
{
LogException(ex);
LogException(ex, innerException: false);

string errorLogPath = SafePath.CombineFilePath(ProgramConstants.ClientUserFilesPath, "ClientCrashLogs", FormattableString.Invariant($"ClientCrashLog{DateTime.Now.ToString("_yyyy_MM_dd_HH_mm")}.txt"));
bool crashLogCopied = false;
Expand Down
Loading