If SteamInternal.GameServer_Init returns false, print the parameters in the error

This commit is contained in:
Garry Newman 2019-05-13 10:37:36 +01:00
parent 6a2db11c5d
commit b6cecf0082

View File

@ -57,13 +57,14 @@ public static void Init( AppId appid, SteamServerInit init )
System.Environment.SetEnvironmentVariable( "SteamAppId", appid.ToString() );
System.Environment.SetEnvironmentVariable( "SteamGameId", appid.ToString() );
var secure = (int)(init.Secure ? 3 : 2);
//
// Get other interfaces
//
if ( !SteamInternal.GameServer_Init( ipaddress, init.SteamPort, init.GamePort, init.QueryPort, (int)( init.Secure ? 3 : 2 ), init.VersionString ) )
if ( !SteamInternal.GameServer_Init( ipaddress, init.SteamPort, init.GamePort, init.QueryPort, secure, init.VersionString ) )
{
throw new System.Exception( "InitGameServer returned false" );
throw new System.Exception( $"InitGameServer returned false ({ipaddress},{init.SteamPort},{init.GamePort},{init.QueryPort},{secure},\"{init.VersionString}\")" );
}
initialized = true;