SteamPort isn't used anymore here

This commit is contained in:
Garry Newman 2021-09-24 14:46:37 +01:00
parent 480137a490
commit f005600957
2 changed files with 2 additions and 16 deletions

View File

@ -69,9 +69,6 @@ namespace Steamworks
uint ipaddress = 0; // Any Port
if ( init.SteamPort == 0 )
init = init.WithRandomSteamPort();
if ( init.IpAddress != null )
ipaddress = Utility.IpToInt32( init.IpAddress );
@ -82,9 +79,9 @@ namespace Steamworks
//
// Get other interfaces
//
if ( !SteamInternal.GameServer_Init( ipaddress, init.SteamPort, init.GamePort, init.QueryPort, secure, init.VersionString ) )
if ( !SteamInternal.GameServer_Init( ipaddress, 0, init.GamePort, init.QueryPort, secure, init.VersionString ) )
{
throw new System.Exception( $"InitGameServer returned false ({ipaddress},{init.SteamPort},{init.GamePort},{init.QueryPort},{secure},\"{init.VersionString}\")" );
throw new System.Exception( $"InitGameServer returned false ({ipaddress},{0},{init.GamePort},{init.QueryPort},{secure},\"{init.VersionString}\")" );
}
//

View File

@ -14,7 +14,6 @@ namespace Steamworks
public struct SteamServerInit
{
public IPAddress IpAddress;
public ushort SteamPort;
public ushort GamePort;
public ushort QueryPort;
public bool Secure;
@ -52,18 +51,8 @@ namespace Steamworks
Secure = true;
VersionString = "1.0.0.0";
IpAddress = null;
SteamPort = 0;
}
/// <summary>
/// Set the Steam quert port
/// </summary>
public SteamServerInit WithRandomSteamPort()
{
SteamPort = (ushort)new Random().Next( 10000, 60000 );
return this;
}
/// <summary>
/// If you pass MASTERSERVERUPDATERPORT_USEGAMESOCKETSHARE into usQueryPort, then it causes the game server API to use
/// "GameSocketShare" mode, which means that the game is responsible for sending and receiving UDP packets for the master