Steam Transport

Host and join matches via Steam’s networking interface

Although SnapNet is primarily designed for use with dedicated servers, it is often helpful during development to host and join matches directly between peers where connectivity can be tricky due to firewalls and network address translation. The Steam transport provides a way to leverage Steam’s networking API and their datagram relay to provide connectivity and security.

Usage

To use the Steam transport, set the transport class for both the server and client to USnapNetSteamTransport. You can set it as the default transport in the editor via Edit → Project Settings → SnapNet → Common → Default Transport Class. This can also be accomplished for a single session via C++ as follows:

SnapNetSubsystem->GetServer()->SetTransportClass( ISnapNetSteamInterface::GetSteamTransportClass() );

SnapNetSubsystem->GetClient()->SetTransportClass( ISnapNetSteamInterface::GetSteamTransportClass() );

To connect to a specific Steam ID and virtual port combination you can specify it as a url in the format SteamID:VirtualPort. For example:

Client->GetTransport()->SetupClientByUrl( TEXT( "76561191234567890:7632" ) );