SteamNetworkingMessage

Swift
public struct SteamNetworkingMessage

Steamworks SteamNetworkingMessage_t


Topics

func set(data: UnsafeMutableRawPointer, size: Int)

Set payload

Declaration
Swift
public func set(data: UnsafeMutableRawPointer, size: Int)

var data: UnsafeMutableRawPointer

Message payload

Declaration
Swift
public var data: UnsafeMutableRawPointer { get }

var size: Int

Size of the payload.

Declaration
Swift
public var size: Int { get }

var conn: HSteamNetConnection

For messages received on connections: what connection did this come from? For outgoing messages: what connection to send it to? Not used when using the ISteamNetworkingMessages interface

Declaration
Swift
public var conn: HSteamNetConnection { get set }

var peerIdentity: SteamNetworkingIdentity

For inbound messages: Who sent this to us? For outbound messages on connections: not used. For outbound messages on the ad-hoc ISteamNetworkingMessages interface: who should we send this to?

Declaration
Swift
public var peerIdentity: SteamNetworkingIdentity { get set }

var connUserData: Int

For messages received on connections, this is the user data associated with the connection.

Declaration
Swift
public var connUserData: Int { get }

var usecTimeReceived: SteamNetworkingMicroseconds

Local timestamp when the message was received

Declaration
Swift
public var usecTimeReceived: SteamNetworkingMicroseconds { get }

var messageNumber: Int

Message number assigned by the sender.

Declaration
Swift
public var messageNumber: Int { get }

func setFreeData(@convention(c) (UnsafeMutableRawPointer) -> Void)

Function used to free up the data buffer when not supplied by Steam. The token passed to this callback should then be converted into a SteamNetworkingMessage using fromFreeDataToken(_:).

Declaration
Swift
public func setFreeData(
    _ f: @escaping @convention(c) (UnsafeMutableRawPointer) -> Void)

static func fromFreeDataToken(UnsafeMutableRawPointer) -> SteamNetworkingMessage

Declaration
Swift
public static func fromFreeDataToken(_ token: UnsafeMutableRawPointer)
    -> SteamNetworkingMessage

func release()

Call when done with the object to decrement refcount and eventually call the free-data callback.

Declaration
Swift
public func release()

var channel: Int

When using ISteamNetworkingMessages, the channel number the message was received on

Declaration
Swift
public var channel: Int { get }

var sendFlags: SteamNetworkingSendFlags

For received messages, only the reliable bit is valid. For outbound messages, all bits are relevant

Declaration
Swift
public var sendFlags: SteamNetworkingSendFlags { get set }

func set(userData: Int)

Arbitrary user data that you can use when sending messages using ISteamNetworkingUtils::AllocateMessage and ISteamNetworkingSockets::SendMessage.

Declaration
Swift
public func set(userData: Int)

var lane: Int

For outbound messages, which lane to use? See ISteamNetworkingSockets::ConfigureConnectionLanes. For inbound messages, what lane was the message received on?

Declaration
Swift
public var lane: Int { get set }