mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2025-01-12 22:58:01 +03:00
SteamPort isn't used anymore here
This commit is contained in:
parent
480137a490
commit
f005600957
@ -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}\")" );
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user