Please Note: There is a complete rebuild utilising Async (Previously SteamNetNetworkTransport) of a Steam P2P network transport layer for Mirror - 2018 branch (vis2k's UNET replacement for Unity) here:
https://github.com/FizzCube/FizzySteamyMirror/
This is for the older 2017 branch (Mirror branch) version and will also remain:
A Steam P2P network transport layer for Mirror (vis2k's UNET replacement for Unity)
SteamNetNetworkTransport uses Steamworks.NET wrapper for the steamworks API.
If you want to dive right in with a basic functional demo then find the example project here which includes with Mirror and Steamworks.NET
https://github.com/FizzCube/SteamNetNetworkTransport-Example
SteamNetNetworkTransport relies on Steamworks.NET to communicate with the Steamworks API.
SteamNetNetworkTransport is also obviously dependant on Mirror which is a streamline, bug fixed, maintained version of UNET for Unity.
Both of these projects need to be installed and working before you can use this transport
- Download and install the dependencies
- Download SteamworksNetworkTransport.cs and place in your Assets folder somewhere. If errors occur, open a Issue ticket.
- In your class extending from Mirror's NetworkManager class, you would do:
public override void InitializeTransport() {
Transport.layer = new SteamworksNetworkTransport();
}
Then, to start as a host:
SteamNetworkManager.singleton.StartHost();
Or, to connect to a host as a client:
CSteamID hostSteamID;
...
SteamNetworkManager.singleton.networkAddress = hostSteamID.ToString();
SteamNetworkManager.singleton.StartClient();
Where hostSteamID is a CSteamID containing the hosts Steam account 64 ID. This is usually got by one of the steam systems like friends or lobbies.