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

Add detailed logs if steam Init fails. #648

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
6 changes: 5 additions & 1 deletion com.rlabrecque.steamworks.net/Runtime/Steam.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public static class SteamAPI {
// Returns true on success
public static ESteamAPIInitResult InitEx(out string OutSteamErrMsg)
{
OutSteamErrMsg = "";
InteropHelp.TestIfPlatformSupported();

var pszInternalCheckInterfaceVersions = new System.Text.StringBuilder();
Expand Down Expand Up @@ -260,7 +261,10 @@ public static ESteamAPIInitResult InitEx(uint unIP, ushort usGamePort, ushort us
}
else {
initResult = ESteamAPIInitResult.k_ESteamAPIInitResult_FailedGeneric;
OutSteamErrMsg = "[Steamworks.NET] Failed to initialize CSteamAPIContext";
if(!string.IsNullOrEmpty(OutSteamErrMsg))
OutSteamErrMsg = $"[Steamworks.NET] Failed to initialize CSteamAPIContext: {OutSteamErrMsg}";
Copy link
Owner

Choose a reason for hiding this comment

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

Can this ever get hit? If OutSteamErrMsg is not empty, does that not also mean we'll never get into the branch at L256?

else
OutSteamErrMsg = "[Steamworks.NET] Failed to initialize CSteamAPIContext";
}
}

Expand Down