Godot Iroh
by tipragot
Installation
Installation via Asset Library
The addon is accessible on the Godot Asset Library here.
Manual Installation
- Download the latest release from releases.
- Extract the archive in your Godot project folder.
- That's it! You're all set!
Usage
This plugin allows you to establish peer-to-peer multiplayer connections in Godot without relying on a centralized server, leveraging the power of Iroh.
Starting a Server
To start a server and set it as the multiplayer peer:
var server := IrohServer.start()
multiplayer.multiplayer_peer = server
You can retrieve the connection string (used to connect to this server) using:
server.connection_string()
After initializing the peer, you can use the High-level multiplayer of Godot as normal.
Connecting as a Client
To connect to an existing server using the connection string:
var client = IrohClient.connect("CONNECTION_STRING")
multiplayer.multiplayer_peer = client
Replace "CONNECTION_STRING"
with the string provided by the client acting as the server.
After initializing the peer, you can use the High-level multiplayer as normal.
Handle Client Errors
To handle connection failures on the client side, you can connect to the connection_failed signal and get the error message with the connection_error
function:
multiplayer.connection_failed.connect(func():
print("Connection error: ", client.connection_error()))
This allows you to gracefully handle cases where the client cannot connect to the server.
Examples
For more examples, see the examples folder in this repository.
Download
Support
If you need help or have questions about this plugin, please contact the author.
Contact Author