Skip to content

A Godot MultiplayerPeer implementation using Steam networking written in C#

License

Notifications You must be signed in to change notification settings

expressobits/steam-multiplayer-peer-csharp

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

SteamMultiplayerPeer for C#

This is an implementation of Godot's MultiplayerPeer (used by the high-level multiplayer API) using Steam for the underlying networking.

To use:

  • Install the GodotSteam extension, or use their pre-compiled Godot binaries: https://github.com/GodotSteam/GodotSteam
  • Copy and paste SteamMultiplayerPeer.cs into your Godot C# project (e.g. /addons/steam-multiplayer-peer-csharp/SteamMultiplayerPeer.cs)
  • Create an instance of SteamMultiplayerPeer and use the CreateServer/CreateClient methods as below:
    private const int VIRTUAL_PORT = 0;

    public void CreateServer() {
        var multiplayerPeer = new SteamMultiplayerPeer();
        var error = multiplayerPeer.CreateServer(VIRTUAL_PORT);

        if (error != Error.Ok) {
            GD.PrintErr("Error creating host: ", error);
            return;
        }

        Multiplayer.MultiplayerPeer = multiplayerPeer;
    }

    public void CreateClient(ulong steamId) {
        var multiplayerPeer = new SteamMultiplayerPeer();
        var error = multiplayerPeer.CreateClient(steamId, VIRTUAL_PORT);

        if (error != Error.Ok) {
            GD.PrintErr("Failed to create client: ", error);
            return;
        }

        Multiplayer.MultiplayerPeer = multiplayerPeer;
    }

Known issues

  • Configuration flags are not yet fully implemented
  • Channels are not implemented

See also:

About

A Godot MultiplayerPeer implementation using Steam networking written in C#

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%