SteamNetworkingIdentity

Swift
public final class SteamNetworkingIdentity: @unchecked Sendable

extension SteamNetworkingIdentity: SteamCreatable, CustomStringConvertible,
    Equatable

Steamworks SteamNetworkingIdentity


Topics

Fields

var type: SteamNetworkingIdentityType

Type of identity

Declaration
Swift
public var type: SteamNetworkingIdentityType { get }

var isValid: Bool

Returns true if we are the invalid type. Does not make any other validity checks (e.g. is Steam ID actually valid)

Declaration
Swift
public var isValid: Bool { get }

var steamID: SteamID

Returns CSteamID (!IsValid() if identity is not a SteamID)

Declaration
Swift
public var steamID: SteamID { get }

var ipAddr: SteamNetworkingIPAddr?

Returns nil if we are not an IP address.

Declaration
Swift
public var ipAddr: SteamNetworkingIPAddr? { get }

var isLocalhost: Bool

Returns true if this identity is localhost.

Declaration
Swift
public var isLocalhost: Bool { get }

var fakeIPType: SteamNetworkingFakeIPType

Declaration
Swift
public var fakeIPType: SteamNetworkingFakeIPType { get }

var isFakeIP: Bool

Declaration
Swift
public var isFakeIP: Bool { get }

var genericString: String?

Returns nil if not generic string type

Declaration
Swift
public var genericString: String? { get }

var genericBytes: [UInt8]?

Returns nil if not generic bytes type

Declaration
Swift
public var genericBytes: [UInt8]? { get }

var description: String

String format, should round-trip

Declaration
Swift
public var description: String { get }

Initializers

init()

Create an invalid identity

Declaration
Swift
public init()

init(SteamID)

Init from a Steam ID

Declaration
Swift
public convenience init(_ steamID: SteamID)

init(SteamNetworkingIPAddr)

Init from an IP address

Declaration
Swift
public convenience init(_ ipaddr: SteamNetworkingIPAddr)

static var localhost: SteamNetworkingIdentity

Identify as localhost, ~anonymous

Declaration
Swift
public static var localhost: SteamNetworkingIdentity { get }

init?(genericString: String, type: SteamNetworkingIdentityType)

Init generic string or some other type. Max length 31 bytes.

Declaration
Swift
public convenience init?(
    genericString: String, type: SteamNetworkingIdentityType = .genericString)

init?(description: String)

Init from a description string.

Declaration
Swift
public convenience init?(description: String)

init?([UInt8], type: SteamNetworkingIdentityType)

Init generic bytes or some other type. Max 32 bytes.

Declaration
Swift
public convenience init?(
    _ bytes: [UInt8], type: SteamNetworkingIdentityType = .genericBytes)

SteamNetworkingIdentity

static func ==(lhs: SteamNetworkingIdentity, rhs: SteamNetworkingIdentity) -> Bool

Returns a Boolean value indicating whether two values are equal.

Equality is the inverse of inequality. For any values a and b, a == b implies that a != b is false.

Declaration
Swift
public static func == (
    lhs: SteamNetworkingIdentity, rhs: SteamNetworkingIdentity
) -> Bool
Parameters
lhs

A value to compare.

rhs

Another value to compare.