Git Product home page Git Product logo

transport.steamworks's Introduction

for use with Vis2k Mirror 2018 Branch, Facepunch.Steamworks and Unity 2018.

Requires using .NET 4.x in Unity

Transport.Steamworks

A transport for Mirror using SteamworksP2P Networking with Facepunch.Steamworks.

Quick Start

  1. Place the prefab Prefabs/SteamworksNetworkManager into the scene.

  2. Set the target network address to the host user's steamid64

  3. Set your App ID.

That's it.

How to use your own prefab

  1. Create a new gameobject with SteamworksNetworkManager.cs and SteamworksTransport.cs attached.

  2. If your NetworkManager is marked as DontDestroyOnLoad, attach Steam.cs as well.

  3. If not, create a new gameobject and attach Steam.cs and set your App ID if not using the testing app (480)

Accessing Facepunch.Steamworks.Client

You could use Client.Instance, then check if null, and IsValid.

There is also Steam.Instance.GetClient(our var client) which can be used like so

if (Steam.Instance.GetClient(out var client)) 
{
    // do something with client
}

Getting Connection ID by steamID, or vice versa

use

// Get ConnectionID from SteamID
if (Steam.Instance.ServerConnectionMap.TryGetByFirst(steamID, out var connectionID)
{
    // do something with connectionID
}
// Get SteamID from ConnectionID
if (Steam.Instance.ServerConnectionMap.TryGetBySecond(connectionID, out var steamID))
{
    // do something with steamID
}

Features

You can use Unreliable, Reliable, or UnreliableNoDelay channels via

[Command(channel = (int) SteamPacketChannel.Unreliable)]

not specifying a channel is the same as

[Command(channel = (int) SteamPacketChannel.Reliable)]

note that SteamPacketChannel.Internal is for the transport to communicate connections / disconnects. Anything sent on this channel will be discarded.

transport.steamworks's People

Contributors

andrew6180 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.