SteamNetworkingMessage
public struct SteamNetworkingMessage
Topics
func set(data: UnsafeMutableRawPointer, size: Int)
func set(data: UnsafeMutableRawPointer, size: Int)
var data: UnsafeMutableRawPointer
var data: UnsafeMutableRawPointer
Message payload
Declaration
public var data: UnsafeMutableRawPointer { get }
var size: Int
var size: Int
var conn: HSteamNetConnection
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
public var conn: HSteamNetConnection { get set }
var peerIdentity: SteamNetworkingIdentity
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
public var peerIdentity: SteamNetworkingIdentity { get set }
var connUserData: Int
var connUserData: Int
For messages received on connections, this is the user data associated with the connection.
Declaration
public var connUserData: Int { get }
var usecTimeReceived: SteamNetworkingMicroseconds
var usecTimeReceived: SteamNetworkingMicroseconds
Local timestamp when the message was received
Declaration
public var usecTimeReceived: SteamNetworkingMicroseconds { get }
var messageNumber: Int
var messageNumber: Int
func setFreeData(@convention(c) (UnsafeMutableRawPointer) -> Void)
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
public func setFreeData(
_ f: @escaping @convention(c) (UnsafeMutableRawPointer) -> Void)
static func fromFreeDataToken(UnsafeMutableRawPointer) -> SteamNetworkingMessage
static func fromFreeDataToken(UnsafeMutableRawPointer) -> SteamNetworkingMessage
Declaration
public static func fromFreeDataToken(_ token: UnsafeMutableRawPointer)
-> SteamNetworkingMessage
func release()
func release()
Call when done with the object to decrement refcount and eventually call the free-data callback.
Declaration
public func release()
var channel: Int
var channel: Int
When using ISteamNetworkingMessages, the channel number the message was received on
Declaration
public var channel: Int { get }
var sendFlags: SteamNetworkingSendFlags
var sendFlags: SteamNetworkingSendFlags
For received messages, only the reliable
bit is valid.
For outbound messages, all bits are relevant
Declaration
public var sendFlags: SteamNetworkingSendFlags { get set }
func set(userData: Int)
func set(userData: Int)
Arbitrary user data that you can use when sending messages using
ISteamNetworkingUtils::AllocateMessage
and ISteamNetworkingSockets::SendMessage
.
Declaration
public func set(userData: Int)
var lane: 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
public var lane: Int { get set }