REPO SteamNetworking Lib
API/Library for networking using Steamworks socket relays. Very much WIP, but still usable, mostly.
About this mod Author’s original text
API for R.E.P.O that allows for networking using Steamworks.
[!IMPORTANT]
This does not allow you to host lobbies using steam or enable local hosting!
This is an API for Mod Developers
so they can offload their mods' networking off of the REPO Photon servers to help the REPO devs save bandwidth.
Check the Full Documentation for up-to-date Docs
Basic documentation is as follows
Set version compatibility
Method A
[RSNVersionCompatibility(VersionCompatibility.Strict, optional: false)] // Defaults
[BepInPlugin(...)]
class ExampleModPlugin: BaseUnityPlugin {...}
Method B
class ExampleModPlugin: BaseUnityPlugin
{
private void Awake()
{
RepoSteamNetwork.SetVersionCompatibility(VersionCompatibility.Strict, plugin: this);
}
}
Create network packet
public class ExamplePacket: NetworkPacket
{
public string ExampleDataString;
public Vector3 ExampleVector;
protected override void WriteData(SocketMessage socketMessage)
{
socketMessage.Write(ExampleDataString);
socketMessage.Write(ExampleVector);
}
protected override void ReadData(SocketMessage socketMessage)
{
ExampleDataString = socketMessage.Read();
ExampleVector = socketMessage.Read();
}
}
Register network packet
RepoSteamNetwork.RegisterPacket();
Setup callback
Method A
Register callback
{...
RepoSteamNetwork.AddCallback(OnExamplePacketReceived);...
}
private static void OnExamplePacketReceived(ExamplePacket packet)
{
// Do stuff with your packet data
Debug.Log($"Received ExamplePacket Data: ({packet.ExampleDataString}, {packet.ExampleVector})");
}
Method B
Do your callback in ReadData in your packet
public class ExamplePacket: NetworkPacket
{...
protected override void ReadData(SocketMessage socketMessage)
{
ExampleDataString = socketMessage.Read();
ExampleVector = socketMessage.Read();
// Do stuff with your data here
Debug.Log($"Received ExamplePacket Data: ({ExampleDataString}, {ExampleVector})");
}
}
Send Packet
var packet = new ExamplePacket
{
ExampleDataString = "Example string here",
ExampleVector = Vector3.One,
}
// By default sends packet to everyone including the user who sends the packet
RepoSteamNetwork.SendPacket(packet);
// or send it only to the host
RepoSteamNetwork.SendPacket(packet, NetworkDestination.HostOnly);
Install & use Install: BepInEx plugin
- The archive from playbuff is the mod itself — usually a BepInEx plugin (a .dll or a plugin folder once unzipped).
- Recommended: use a community mod manager (such as r2modman) — pick this game, import the mod, and the manager sets up BepInEx and its dependencies for you.
- Manual route: install the BepInEx loader in the game folder, then drop the unzipped .dll or plugin folder into BepInEx/plugins/.
- Launch the game — the BepInEx console logs every plugin it loads; seeing this mod in the log means it is installed.
Mods with listed dependencies need those installed too, or they will not load. Options are usually changed in-game or in the plugin's config file.
Install these first, or the mod will not work: